Current File : //usr/lib/python2.7/site-packages/setuptools/config.pyo
�
�fc@@s�ddlmZmZddlZddlZddlZddlmZddlm Z ddl
mZddlm
Z
mZddlmZeed�Zd �Zed
�Zdefd��YZd
efd��YZdefd��YZdS(i(tabsolute_importtunicode_literalsN(tdefaultdict(tpartial(t
import_module(tDistutilsOptionErrortDistutilsFileError(tstring_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(tDistributiont
_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@s�tt�}x|D]w}|j}|j}x\|jD]Q}t|d|d�}|dkrot||�}n |�}||||<q5WqW|S(u�Returns 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||�}|j�t|||�}|j�||fS(u�Performs 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(tdistributionRRtmetatoptions((s5/usr/lib/python2.7/site-packages/setuptools/config.pyRYs
t
ConfigHandlercB@s�eZdZdZiZed�Zed��Z d�Z
edd��Zed��Z
ed��Zed��Zed ��Zed
��Zed��Zed��Zedd
��Zd�Zd�ZRS(u1Handles metadata supplied in configuration files.cC@s�i}|j}xT|j�D]F\}}|j|�s=qn|j|d�jd�}|||<qW||_||_||_g|_dS(Nuu.( R!titemst
startswithtreplacetstripRR"tsectionsR#(tselfR"R2RR8R!tsection_nametsection_options((s5/usr/lib/python2.7/site-packages/setuptools/config.pyt__init__�s cC@std|jj��dS(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.pytparsers�sc C@st�}|j}|jj||�}t|||�}||krTt|��n|r^dSt}|jj|�}|r�y||�}Wq�tk
r�t }|j
s��q�q�Xn|r�dSt|d|d�}|dkr�t|||�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|t�r|Sd|kr.|j�}n|j|�}g|D]}|j�rD|j�^qDS(u�Represents 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_list�s
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_dict�scC@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_bool�sc@srd}t|t�s|S|j|�s,|S|t|�}d�|jd�D�}dj�fd�|D��S(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|j��VqdS(N(R
RRR7(t.0R((s5/usr/lib/python2.7/site-packages/setuptools/config.pys <genexpr>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 <genexpr> s(RPRR5tlenRStjoin(RTR+tinclude_directivetspect filepaths((RTs5/usr/lib/python2.7/site-packages/setuptools/config.pyt_parse_file�scC@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_nametmodule_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]"\}\}}||�||<q"W|S(u�Parses 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>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|||<Wq
tk
r@q
Xq
WdS(uQParses configuration file section.
:param dict section_options:
N(R4RD(R9R;tnameRR+((s5/usr/lib/python2.7/site-packages/setuptools/config.pyt
parse_section\s
cC@s�x�|jj�D]y\}}d}|r5d|}nt|d|jdd�d�}|dkrtd|j|f��n||�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`RitstaticmethodRbRcRwR{R�R�R.(((s5/usr/lib/python2.7/site-packages/setuptools/config.pyR3ss& &
R,cB@sNeZdZidd6dd6dd6dd6ZeZed ��Zd
�ZRS(umetadatauurlu home_pageudescriptionusummaryuclassifiersu
classifieru platformsuplatformcC@s{|j}|j}|j}i|d6|d6|d6|d6|d6|j||�d6|d6|d6|d 6|jd
6|d6S(u.Metadata item name to parser function mapping.u platformsukeywordsuprovidesurequiresu obsoletesuclassifiersulicenseudescriptionulong_descriptionuversionuproject_urls(RWRiR^R{t_parse_version(R9t
parse_listt
parse_filet
parse_dict((s5/usr/lib/python2.7/site-packages/setuptools/config.pyR@�s
cC@sq|j|�}t|�r'|�}nt|t�smt|d�r`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.pyR��s
( R?R�R!RBREtstrict_modeR�R@R�(((s5/usr/lib/python2.7/site-packages/setuptools/config.pyR,�s
R/cB@s\eZdZed��Zd�Zd�Zd�Zd�Zd�Z d�Z
d�ZRS( uoptionscC@s�|j}t|jdd�}|j}|j}i|d6|d6|d6|d6|d6|d6|d 6|d
6|d6|d6|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_requireupackagesuentry_pointsu
py_modules(RWRR`R^t_parse_packagesRi(R9R�tparse_list_semicolont
parse_boolR�((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.pyR��s
cC@s�|j||j�}dddg}tg|j�D]*\}}||kr4|r4||f^q4�}|jd�}|dk r�|d|d<n|S(u�Parses `packages.find` configuration file section.
To be used in conjunction with _parse_packages().
:param dict section_options:
uwhereuincludeuexcludeiN(R�RWR R4RCR%(R9R;tsection_datat
valid_keystktvR�twhere((s5/usr/lib/python2.7/site-packages/setuptools/config.pyR��s@cC@s#|j||j�}||d<dS(u`Parses `entry_points` configuration file section.
:param dict section_options:
uentry_pointsN(R�RW(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(R�RWRC(R9R;Rxtroot((s5/usr/lib/python2.7/site-packages/setuptools/config.pyt_parse_package_datas
cC@s|j|�|d<dS(u`Parses `package_data` configuration file section.
:param dict section_options:
upackage_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?R�R!R�R@R�R�R�R�R�R�R�(((s5/usr/lib/python2.7/site-packages/setuptools/config.pyR/�s
(t
__future__RRRkR
RptcollectionsRt functoolsRt importlibRtdistutils.errorsRRtsetuptools.extern.sixRRERRRtobjectR3R,R/(((s5/usr/lib/python2.7/site-packages/setuptools/config.pyt<module>s. �;