ó Àfc@@súddlmZmZddlZddlZddlZddlmZddlm Z ddl m Z ddl m Z mZddlmZeed„Zd „Zed „Zd efd „ƒYZd efd„ƒYZdefd„ƒYZdS(i(tabsolute_importtunicode_literalsN(t defaultdict(tpartial(t import_module(tDistutilsOptionErrortDistutilsFileError(t string_typesc C@sùddlm}m}tjj|ƒ}tjj|ƒsMtd|ƒ‚ntjƒ}tj tjj |ƒƒzl|ƒ}|r|j ƒng}||kr²|j |ƒn|j |d|ƒt||jd|ƒ}Wdtj |ƒXt|ƒS(u,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 i(t Distributiont _Distributionu%Configuration file %s does not exist.t filenamestignore_option_errorsN(tsetuptools.distRR tostpathtabspathtisfileRtgetcwdtchdirtdirnametfind_config_filestappendtparse_config_filestparse_configurationtcommand_optionstconfiguration_to_dict( tfilepatht find_othersR RR tcurrent_directorytdistR thandlers((s5/usr/lib/python2.7/site-packages/setuptools/config.pytread_configuration s$     cC@s’ttƒ}x|D]w}|j}|j}x\|jD]Q}t|d|dƒ}|dkrot||ƒ}n |ƒ}||||su,u c3@sE|];}ˆj|ƒstrtjj|ƒrˆj|ƒVqdS(N(t _assert_localRGR RRt _read_file(RaR(RT(s5/usr/lib/python2.7/site-packages/setuptools/config.pys s(RPRR5tlenRStjoin(RTR+tinclude_directivetspect filepaths((RTs5/usr/lib/python2.7/site-packages/setuptools/config.pyt _parse_fileïs cC@s,|jtjƒƒs(td|ƒ‚ndS(Nu#`file:` directive can not access %s(R5R RR(R((s5/usr/lib/python2.7/site-packages/setuptools/config.pyRbscC@s,tj|ddƒ}|jƒSWdQXdS(Ntencodinguutf-8(tiotopentread(Rtf((s5/usr/lib/python2.7/site-packages/setuptools/config.pyRcscC@s±d}|j|ƒs|S|j|dƒjƒjdƒ}|jƒ}dj|ƒ}|p^d}tjjdt j ƒƒzt |ƒ}t ||ƒ}Wdtjdt_X|S(u·Represents value as a module attribute. Examples: attr: package.attr attr: package.module.attr :param str value: :rtype: str uattr:uu.u__init__iNi( R5R6R7RStpopRetsysRtinsertR RRR$(RTR+tattr_directivet attrs_patht attr_namet module_nametmodule((s5/usr/lib/python2.7/site-packages/setuptools/config.pyt _parse_attrs !   c@s‡fd†}|S(u¹Returns parser function to represents value as a list. Parses a value applying given methods one after another. :param parse_methods: :rtype: callable c@s'|}xˆD]}||ƒ}q W|S(N((R+tparsedtmethod(t parse_methods(s5/usr/lib/python2.7/site-packages/setuptools/config.pyR.Bs ((RTRzR.((Rzs5/usr/lib/python2.7/site-packages/setuptools/config.pyt_get_parser_compound9s cC@sLi}|pd„}x0|jƒD]"\}\}}||ƒ||Wt(R4(RTR;t values_parserR+R[t_R]((s5/usr/lib/python2.7/site-packages/setuptools/config.pyt_parse_section_to_dictLs cC@sIxB|jƒD]4\}\}}y|||||d<|d=n|S(Nu*u(R€RWRC(R9R;Rxtroot((s5/usr/lib/python2.7/site-packages/setuptools/config.pyt_parse_package_data s   cC@s|j|ƒ|ds   .  ÿ;