Y>@sddlmZmZddlZddlZddlZddlmZddlm Z ddl m Z m Z ddl mZddlmZddd d Zd d Zdd dZGdddeZGdddeZGdddeZdS))absolute_importunicode_literalsN) defaultdict)partial)DistutilsOptionErrorDistutilsFileError) import_module) string_typesFc Csddlm}m}tjj|}tjj|sJtd|tj}tj tjj |zi|}|r|j ng}||kr|j ||j |d|t||jd|}Wdtj |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. filenamesignore_option_errorsN)Zsetuptools.distr r ospathabspathisfilergetcwdchdirdirnamefind_config_filesappendparse_config_filesparse_configurationcommand_optionsconfiguration_to_dict) filepathZ find_othersr r r current_directorydistr handlersr7/tmp/pip-build-3puug3g5/setuptools/setuptools/config.pyread_configuration s$       r!cCstt}x|D]w}|j}|j}x\|jD]Q}t|d|d}|dkrot||}n |}||||s z-ConfigHandler._parse_list..) isinstancelist splitlinessplit)clsr* separatorrrr _parse_lists  zConfigHandler._parse_listcCstd}i}xa|j|D]P}|j|\}}}||krVtd||j||j.parser)rUrvr-r)rvr _get_parser_compound3s z"ConfigHandler._get_parser_compoundcCsOi}|pdd}x0|jD]"\}\}}||||Qsz6ConfigHandler._parse_section_to_dict..)r5)rUr<Z values_parserr*r\_r^rrr _parse_section_to_dictFs z$ConfigHandler._parse_section_to_dictc CsJxC|jD]5\}\}}y|||.Nr)rzrWr"r5rD)r:r<Z section_datarrr)rr rs" z1ConfigOptionsHandler.parse_section_packages__findcCs#|j||j}||ds   .  9