ó à\e[c@@sddlmZmZddlZddlZddlZddlmZddlm Z ddl m Z ddl m Z mZddlmZmZddlmZeZeed „Zd „Zed „Zd fd „ƒYZdefd„ƒYZdefd„ƒYZdS(i(tabsolute_importtunicode_literalsN(t defaultdict(tpartial(t import_module(tDistutilsOptionErrortDistutilsFileError(t LegacyVersiontparse(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.distR R tostpathtabspathtisfileRtgetcwdtchdirtdirnametfind_config_filestappendtparse_config_filestparse_configurationtcommand_optionstconfiguration_to_dict( tfilepatht find_othersR R R tcurrent_directorytdistR thandlers((s7/tmp/pip-install-0xiv62/setuptools/setuptools/config.pytread_configurations$     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_localRIRRRt _read_file(RcR(RV(s7/tmp/pip-install-0xiv62/setuptools/setuptools/config.pys s(RRR R7tlenRUtjoin(RVR-tinclude_directivetspect filepaths((RVs7/tmp/pip-install-0xiv62/setuptools/setuptools/config.pyt _parse_fileós cC@s,|jtjƒƒs(td|ƒ‚ndS(Nu#`file:` directive can not access %s(R7RRR(R((s7/tmp/pip-install-0xiv62/setuptools/setuptools/config.pyRdscC@s,tj|ddƒ}|jƒSWdQXdS(Ntencodinguutf-8(tiotopentread(Rtf((s7/tmp/pip-install-0xiv62/setuptools/setuptools/config.pyResc C@sed}|j|ƒs|S|j|dƒjƒjdƒ}|jƒ}dj|ƒ}|p^d}tjƒ}|r|d|krê||d}|jddƒ} t | ƒdkrátj jtjƒ| dƒ}| d}q|}qd|krtj jtjƒ|dƒ}qnt j j d|ƒzt |ƒ} t| |ƒ}Wdt j dt _ 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__iu/iN(R7R8R9RUtpopRgRRtrsplitRfRtsystinsertRR&( RVR-R1tattr_directivet attrs_patht attr_namet module_namet parent_patht custom_pathtpartstmodule((s7/tmp/pip-install-0xiv62/setuptools/setuptools/config.pyt _parse_attrs0 !      % 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(s7/tmp/pip-install-0xiv62/setuptools/setuptools/config.pyRTs ((RVR€R((R€s7/tmp/pip-install-0xiv62/setuptools/setuptools/config.pyt_get_parser_compoundKs cC@sLi}|pd„}x0|jƒD]"\}\}}||ƒ||is(R6(RVR=t values_parserR-R]t_R_((s7/tmp/pip-install-0xiv62/setuptools/setuptools/config.pyt_parse_section_to_dict^s cC@sIxB|jƒD]4\}\}}y|||tpropertyRBRQt classmethodRYR`RbRkt staticmethodRdReR}RR…R‡R(((s7/tmp/pip-install-0xiv62/setuptools/setuptools/config.pyR5ws(  &  , R/cB@s]eZdZidd6dd6dd6dd6ZeZed d „Zed „ƒZ d „Z RS( umetadatauurlu home_pageu descriptionusummaryu classifiersu classifieru platformsuplatformcC@s)tt|ƒj|||ƒ||_dS(N(tsuperR/R>R1(R;R$R3R R1((s7/tmp/pip-install-0xiv62/setuptools/setuptools/config.pyR>¤scC@s{|j}|j}|j}i |d6|d6|d6|d6|d6|j||ƒd6|d6|d6|d 6|jd 6|d 6S( u.Metadata item name to parser function mapping.u platformsukeywordsuprovidesurequiresu obsoletesu classifiersulicenseu descriptionulong_descriptionuversionu project_urls(RYRkR`Rt_parse_version(R;t parse_listt parse_filet parse_dict((s7/tmp/pip-install-0xiv62/setuptools/setuptools/config.pyRBªs    cC@sÐ|j|ƒ}||krY|jƒ}tt|ƒtƒrUtd||fƒ‚n|S|j||jƒ}t|ƒr†|ƒ}nt|t ƒsÌt |dƒr¿dj t t |ƒƒ}qÌd|}n|S(uSParses `version` option value. :param value: :rtype: str u7Version loaded from %s does not comply with PEP 440: %su__iter__u.u%s(RkR9RRRRRR}R1tcallableR thasattrRgtmaptstr(R;R-tversion((s7/tmp/pip-install-0xiv62/setuptools/setuptools/config.pyR¿s     N( RARŠR#RDRGt strict_modeR'R>RŒRBR(((s7/tmp/pip-install-0xiv62/setuptools/setuptools/config.pyR/“s  R.cB@s\eZdZed„ƒZd„Zd„Zd„Zd„Zd„Z d„Z d„Z RS( uoptionscC@s±|j}t|jddƒ}|j}|j}i|d6|d6|d6|d6|d6|d6|d 6|d 6|d 6|d 6|d 6|d6|d6|d6|jd6|jd6|d6S(u.Metadata item name to parser function mapping.RWu;uzip_safeuuse_2to3uinclude_package_datau package_diruuse_2to3_fixersuuse_2to3_exclude_fixersuconvert_2to3_doctestsuscriptsueager_resourcesudependency_linksunamespace_packagesuinstall_requiresusetup_requiresu tests_requireupackagesu entry_pointsu py_modules(RYRRbR`t_parse_packagesRk(R;R‘tparse_list_semicolont parse_boolR“((s7/tmp/pip-install-0xiv62/setuptools/setuptools/config.pyRBäs,     cC@sZd}|j|ƒs"|j|ƒS|j|jjdiƒƒ}ddlm}||S(uTParses `packages` option value. :param value: :rtype: list ufind:u packages.findi(t find_packages(R7RYtparse_section_packages__findR:REt setuptoolsR(R;R-tfind_directivet find_kwargsR((s7/tmp/pip-install-0xiv62/setuptools/setuptools/config.pyRšs cC@s—|j||jƒ}dddg}tg|jƒD]*\}}||kr4|r4||f^q4ƒ}|jdƒ}|dk r“|d|d||d<|d=n|S(Nu*u(R…RYRE(R;R=R~troot((s7/tmp/pip-install-0xiv62/setuptools/setuptools/config.pyt_parse_package_data0s   cC@s|j|ƒ|ds"   .  ÿM