Your IP : 18.117.184.236
�Re�? � @ s d d l m Z m Z d d l Z d d l Z d d l Z d d l m Z d d l m Z d d l
m Z m Z d d l
m Z d d l m Z d d d d
� Z d d � Z d d
d � Z Gd d � d e � Z Gd d � d e � Z Gd d � d e � Z d S)� )�absolute_import�unicode_literalsN)�defaultdict)�partial)�DistutilsOptionError�DistutilsFileError)�
import_module)�string_typesFc C s� d d l m } m } t j j | � } t j j | � sJ t d | � � t j � } t j t j j
| � � zi | � } | r� | j � n g } | | k r� | j | � | j
| d | �t | | j d | �} Wd t j | � Xt | � S)a, Read given configuration file and returns options from it as a dict.
:param str|unicode filepath: Path to configuration file
to get options from.
:param bool find_others: Whether to search for other configuration files
which could be on in various places.
:param bool ignore_option_errors: Whether to silently ignore
options, values of which could not be resolved (e.g. due to exceptions
in directives such as file:, attr:, etc.).
If False exceptions are propagated as expected.
:rtype: dict
r )�Distribution�
_Distributionz%Configuration file %s does not exist.� filenames�ignore_option_errorsN)Zsetuptools.distr
r �os�path�abspath�isfiler �getcwd�chdir�dirname�find_config_files�append�parse_config_files�parse_configuration�command_options�configuration_to_dict) �filepathZfind_othersr
r
r Zcurrent_directory�distr �handlers� r ��/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/config.py�read_configuration
s$
r c C s� t t � } x | D]w } | j } | j } x\ | j D]Q } t | d | d � } | d k ro t | | � } n | � } | | | | <q5 Wq W| S)z�Returns configuration data gathered by given handlers as a dict.
:param list[ConfigHandler] handlers: Handlers list,
usually from parse_configuration()
:rtype: dict
zget_%sN)r �dict�section_prefix�
target_obj�set_options�getattr)r Zconfig_dict�handlerZ obj_aliasr# �option�getter�valuer r r r <