usr/lib/python2.7/site-packages/setuptools/config.pyc000064400000040770147205072040016627 0ustar00 fc@@sddlmZmZddlZddlZddlZddlmZddlm Z ddl m Z ddl m Z mZddlmZeedZd Zed Zd efd YZd efdYZdefdYZdS(i(tabsolute_importtunicode_literalsN(t defaultdict(tpartial(t import_module(tDistutilsOptionErrortDistutilsFileError(t string_typesc C@sddlm}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@stt}x|D]w}|j}|j}x\|jD]Q}t|d|d}|dkrot||}n |}||||su,u c3@sE|];}j|strtjj|rj|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_files cC@s,|jtjs(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}|jSWdQXdS(Ntencodinguutf-8(tiotopentread(Rtf((s5/usr/lib/python2.7/site-packages/setuptools/config.pyRcscC@sd}|j|s|S|j|djjd}|j}dj|}|p^d}tjjdt j zt |}t ||}Wdtjdt_X|S(uRepresents 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@sfd}|S(uReturns parser function to represents value as a list. Parses a value applying given methods one after another. :param parse_methods: :rtype: callable c@s'|}xD]}||}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|jD]"\}\}}||||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|jD]4\}\}}y|||||d<|d=n|S(Nu*u(RRWRC(R9R;Rxtroot((s5/usr/lib/python2.7/site-packages/setuptools/config.pyt_parse_package_data s   cC@s|j||ds   .  ;