• File: config.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/lib/python2.7/site-packages/setuptools/config.pyc
  • Date Modified: 05/07/2020 3:04 PM
  • File size: 16.46 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit

#^c@@sddlmZmZddlZddlZddlZddlmZddlm	Z	ddl
mZmZddl
mZddlmZeedZd	Zed
ZdefdYZd
efdYZdefdYZdS(i(tabsolute_importtunicode_literalsN(tdefaultdict(tpartial(tDistutilsOptionErrortDistutilsFileError(t
import_module(tstring_typesc	C@sddlm}m}tjj|}tjj|sMtd|ntj}tj	tjj
|zl|}|r|jng}||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(	tfilepathtfind_othersRRR	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	|}||||<q5WqW|S(uReturns configuration data gathered by given handlers as a dict.

    :param list[ConfigHandler] handlers: Handlers list,
        usually from parse_configuration()

    :rtype: dict
    uget_%sN(Rtdicttsection_prefixt
target_objtset_optionstgetattrtNone(Rtconfig_dictthandlert	obj_aliasR"toptiontgettertvalue((s5/usr/lib/python2.7/site-packages/setuptools/config.pyR<s
			cC@sEt|j||}|jt|||}|j||gS(uPerforms additional parsing of configuration options
    for a distribution.

    Returns a list of used option handlers.

    :param Distribution distribution:
    :param dict command_options:
    :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: list
    (tConfigMetadataHandlertmetadatatparsetConfigOptionsHandler(tdistributionRRtmetatoptions((s5/usr/lib/python2.7/site-packages/setuptools/config.pyRYs

t
ConfigHandlercB@seZdZdZiZedZedZ	dZ
eddZedZ
edZedZed	Zed
ZedZedZedd
ZdZdZRS(u1Handles metadata supplied in configuration files.cC@si}|j}xT|jD]F\}}|j|s=qn|j|djd}|||<qW||_||_||_g|_dS(Nuu.(	R!titemst
startswithtreplacetstripRR"tsectionsR#(tselfR"R2RR8R!tsection_nametsection_options((s5/usr/lib/python2.7/site-packages/setuptools/config.pyt__init__s				cC@std|jjdS(u.Metadata item name to parser function mapping.u!%s must provide .parsers propertyN(tNotImplementedErrort	__class__t__name__(R9((s5/usr/lib/python2.7/site-packages/setuptools/config.pytparserssc	C@st}|j}|jj||}t|||}||krTt|n|r^dSt}|jj|}|ry||}Wqtk
rt	}|j
sqqXn|rdSt|d|d}|dkrt|||n
|||j
j|dS(Nuset_%s(ttupleR"taliasestgetR$tKeyErrortFalseR@t	ExceptiontTrueRR%tsetattrR#R(	R9toption_nameR+tunknownR"t
current_valuetskip_optiontparsertsetter((s5/usr/lib/python2.7/site-packages/setuptools/config.pyt__setitem__s0		
	

u,cC@sft|tr|Sd|kr.|j}n|j|}g|D]}|jrD|j^qDS(uRepresents value as a list.

        Value is split either by separator (defaults to comma) or by lines.

        :param value:
        :param separator: List items separator character.
        :rtype: list
        u
(t
isinstancetlistt
splitlinestsplitR7(tclsR+t	separatortchunk((s5/usr/lib/python2.7/site-packages/setuptools/config.pyt_parse_lists
cC@swd}i}xd|j|D]S}|j|\}}}||krYtd|n|j||j<qW|S(uPRepresents value as a dict.

        :param value:
        :rtype: dict
        u=u(Unable to parse option value to dict: %s(RWt	partitionRR7(RTR+RUtresulttlinetkeytseptval((s5/usr/lib/python2.7/site-packages/setuptools/config.pyt_parse_dictscC@s|j}|dkS(uQRepresents value as boolean.

        :param value:
        :rtype: bool
        u1utrueuyes(u1utrueuyes(tlower(RTR+((s5/usr/lib/python2.7/site-packages/setuptools/config.pyt_parse_boolsc@srd}t|ts|S|j|s,|S|t|}d|jdD}djfd|DS(uiRepresents value as a string, allowing including text
        from nearest files using `file:` directive.

        Directive is sandboxed and won't reach anything outside
        directory with setup.py.

        Examples:
            file: LICENSE
            file: README.rst, CHANGELOG.md, src/file.txt

        :param str value:
        :rtype: str
        ufile:cs@s'|]}tjj|jVqdS(N(R
RRR7(t.0R((s5/usr/lib/python2.7/site-packages/setuptools/config.pys	<genexpr>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	<genexpr>	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_nametmodule_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]"\}\}}||||<q"W|S(uParses section options into a dictionary.

        Optionally applies a given parser to values.

        :param dict section_options:
        :param callable values_parser:
        :rtype: dict
        cS@s|S(N((R]((s5/usr/lib/python2.7/site-packages/setuptools/config.pyt<lambda>Ws(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|||<Wq
tk
r@q
Xq
WdS(uQParses configuration file section.

        :param dict section_options:
        N(R4RD(R9R;tnameR~R+((s5/usr/lib/python2.7/site-packages/setuptools/config.pyt
parse_section\s

cC@sx|jjD]y\}}d}|r5d|}nt|d|jddd}|dkrtd|j|fn||qWdS(uTParses configuration file items from one
        or more related sections.

        uu_%suparse_section%su.u__u0Unsupported distribution option section: [%s.%s]N(R8R4R$R6R%RR!(R9R:R;tmethod_postfixtsection_parser_method((s5/usr/lib/python2.7/site-packages/setuptools/config.pyR.hs
	N(R?t
__module__t__doc__R%R!RBRER<tpropertyR@ROtclassmethodRWR^R`RitstaticmethodRbRcRwR{RRR.(((s5/usr/lib/python2.7/site-packages/setuptools/config.pyR3ss&	&
 	R,cB@sNeZdZidd6dd6dd6dd6ZeZed	Zd
ZRS(umetadatauurlu	home_pageudescriptionusummaryuclassifiersu
classifieru	platformsuplatformcC@sk|j}|j}i
|d6|d6|d6|d6|d6|j||d6|d6|d6|d	6|jd
6S(u.Metadata item name to parser function mapping.u	platformsukeywordsuprovidesurequiresu	obsoletesuclassifiersulicenseudescriptionulong_descriptionuversion(RWRiR{t_parse_version(R9t
parse_listt
parse_file((s5/usr/lib/python2.7/site-packages/setuptools/config.pyR@s		cC@sq|j|}t|r'|}nt|tsmt|dr`djtt|}qmd|}n|S(uSParses `version` option value.

        :param value:
        :rtype: str

        u__iter__u.u%s(RwtcallableRPRthasattrRetmaptstr(R9R+tversion((s5/usr/lib/python2.7/site-packages/setuptools/config.pyRs
(	R?RR!RBREtstrict_modeRR@R(((s5/usr/lib/python2.7/site-packages/setuptools/config.pyR,s
R/cB@s\eZdZedZdZdZdZdZdZ	dZ
dZRS(	uoptionscC@s|j}t|jdd}|j}|j}i|d6|d6|d6|d6|d6|d6|d	6|d
6|d6|d6|d
6|d6|d6|d6|jd6|jd6|d6S(u.Metadata item name to parser function mapping.RUu;uzip_safeuuse_2to3uinclude_package_dataupackage_diruuse_2to3_fixersuuse_2to3_exclude_fixersuconvert_2to3_doctestsuscriptsueager_resourcesudependency_linksunamespace_packagesuinstall_requiresusetup_requiresu
tests_requireupackagesuentry_pointsu
py_modules(RWRR`R^t_parse_packagesRi(R9Rtparse_list_semicolont
parse_boolt
parse_dict((s5/usr/lib/python2.7/site-packages/setuptools/config.pyR@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(R5RWtparse_section_packages__findR8RCt
setuptoolsR(R9R+tfind_directivetfind_kwargsR((s5/usr/lib/python2.7/site-packages/setuptools/config.pyRs
cC@s|j||j}dddg}tg|jD]*\}}||kr4|r4||f^q4}|jd}|dk	r|d|d<n|S(uParses `packages.find` configuration file section.

        To be used in conjunction with _parse_packages().

        :param dict section_options:
        uwhereuincludeuexcludeiN(RRWR R4RCR%(R9R;tsection_datat
valid_keystktvRtwhere((s5/usr/lib/python2.7/site-packages/setuptools/config.pyRs@cC@s#|j||j}||d<dS(u`Parses `entry_points` configuration file section.

        :param dict section_options:
        uentry_pointsN(RRW(R9R;Rx((s5/usr/lib/python2.7/site-packages/setuptools/config.pytparse_section_entry_pointsscC@sB|j||j}|jd}|r>||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||d<dS(u`Parses `package_data` configuration file section.

        :param dict section_options:
        upackage_dataN(R(R9R;((s5/usr/lib/python2.7/site-packages/setuptools/config.pytparse_section_package_datascC@s|j||d<dS(uhParses `exclude_package_data` configuration file section.

        :param dict section_options:
        uexclude_package_dataN(R(R9R;((s5/usr/lib/python2.7/site-packages/setuptools/config.pyt"parse_section_exclude_package_datascC@s/t|jdd}|j|||d<dS(ubParses `extras_require` configuration file section.

        :param dict section_options:
        RUu;uextras_requireN(RRWR(R9R;R((s5/usr/lib/python2.7/site-packages/setuptools/config.pytparse_section_extras_require#s(R?RR!RR@RRRRRRR(((s5/usr/lib/python2.7/site-packages/setuptools/config.pyR/s				
		(t
__future__RRRkR
RptcollectionsRt	functoolsRtdistutils.errorsRRtsetuptools.py26compatRtsetuptools.extern.sixRRERRRtobjectR3R,R/(((s5/usr/lib/python2.7/site-packages/setuptools/config.pyt<module>s.	9