ROOTPLOIT
Server: LiteSpeed
System: Linux server71.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User: niphet (1079)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/setuptools/__pycache__/config.cpython-36.opt-1.pyc
3

vhVF@sddlmZmZddlZddlZddlZddlmZddlm	Z	ddl
mZddlm
Z
mZddlmZmZddlmZdd
dZdd
ZdddZGdddeZGdddeZGdddeZdS))absolute_importunicode_literalsN)defaultdict)partial)
import_module)DistutilsOptionErrorDistutilsFileError)
LegacyVersionparse)string_typesFc	Csddlm}m}tjj|}tjj|s4td|tj}tj	tjj
|zJ|}|rb|jng}||krx|j||j
||dt||j|d}Wdtj	|Xt|S)a,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
    r)Distribution
_Distributionz%Configuration file %s does not exist.)	filenames)ignore_option_errorsN)Zsetuptools.distrr
ospathabspathisfilergetcwdchdirdirnameZfind_config_filesappendZparse_config_filesparse_configurationcommand_optionsconfiguration_to_dict)	filepathZfind_othersrrr
Zcurrent_directoryZdistrhandlersr/usr/lib/python3.6/config.pyread_configurations$

rcCsltt}x^|D]V}|j}|j}xD|jD]:}t|d|d}|dkrNt||}n|}||||<q&WqW|S)zReturns configuration data gathered by given handlers as a dict.

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

    :rtype: dict
    zget_%sN)rdictsection_prefix
target_objset_optionsgetattr)rZconfig_dictZhandlerZ	obj_aliasr"Zoptiongettervaluerrrr=s
rcCs6t|||}|jt|j|||j}|j||fS)aPerforms 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
    )ConfigOptionsHandlerr
ConfigMetadataHandlermetadatapackage_dir)ZdistributionrroptionsmetarrrrZs
rc@seZdZdZdZiZd!ddZeddZdd	Z	e
d"ddZe
d
dZe
ddZ
e
ddZeddZeddZe
d#ddZe
ddZe
d$ddZddZdd ZdS)%
ConfigHandlerz1Handles metadata supplied in configuration files.NFcCsbi}|j}x:|jD].\}}|j|s(q|j|djd}|||<qW||_||_||_g|_dS)N.)	r!items
startswithreplacestriprr"sectionsr#)selfr"r+rr4r!section_namesection_optionsrrr__init__s
zConfigHandler.__init__cCstd|jjdS)z.Metadata item name to parser function mapping.z!%s must provide .parsers propertyN)NotImplementedError	__class____name__)r5rrrparsersszConfigHandler.parsersc	Cst}|j}|jj||}t|||}||kr6t||r>dSd}|jj|}|ry||}Wn tk
r~d}|jszYnX|rdSt|d|d}|dkrt	|||n|||j
j|dS)NFTzset_%s)tupler"aliasesgetr$KeyErrorr<	Exceptionrsetattrr#r)	r5Zoption_namer&unknownr"Z
current_valueZskip_optionparsersetterrrr__setitem__s0zConfigHandler.__setitem__,cCs8t|tr|Sd|kr |j}n
|j|}dd|DS)zRepresents 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
        
cSsg|]}|jr|jqSr)r3).0chunkrrr
<listcomp>sz-ConfigHandler._parse_list.<locals>.<listcomp>)
isinstancelist
splitlinessplit)clsr&	separatorrrr_parse_lists



zConfigHandler._parse_listcCsTd}i}xF|j|D]8}|j|\}}}||kr<td||j||j<qW|S)zPRepresents value as a dict.

        :param value:
        :rtype: dict
        =z(Unable to parse option value to dict: %s)rR	partitionrr3)rPr&rQresultlinekeysepvalrrr_parse_dicts
zConfigHandler._parse_dictcCs|j}|dkS)zQRepresents value as boolean.

        :param value:
        :rtype: bool
        1trueyes)r[r\r])lower)rPr&rrr_parse_boolszConfigHandler._parse_boolcs\d}t|ts|S|j|s |S|t|d}dd|jdD}djfdd|DS)aiRepresents 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
        zfile:Ncss|]}tjj|jVqdS)N)rrrr3)rIrrrr	<genexpr>sz,ConfigHandler._parse_file.<locals>.<genexpr>rGrHc3s2|]*}j|sdrtjj|rj|VqdS)TN)
_assert_localrrr
_read_file)rIr)rPrrr`
s)rLrr1lenrOjoin)rPr&Zinclude_directivespecZ	filepathsr)rPr_parse_files


zConfigHandler._parse_filecCs|jtjstd|dS)Nz#`file:` directive can not access %s)r1rrr)rrrrraszConfigHandler._assert_localc	Cs"tj|dd
}|jSQRXdS)Nzutf-8)encoding)ioopenread)rfrrrrbszConfigHandler._read_filecCsd}|j|s|S|j|djjd}|j}dj|}|p@d}tj}|r|d|kr||d}|jdd}	t	|	dkrtj
jtj|	d}|	d}q|}nd|krtj
jtj|d}tj
jd|zt
|}
t|
|}Wdtj
ddt_
X|S)	zRepresents value as a module attribute.

        Examples:
            attr: package.attr
            attr: package.module.attr

        :param str value:
        :rtype: str
        zattr:r.r/r8r/N)r1r2r3rOpoprdrrrsplitrcrsysinsertrr$)rPr&r*Zattr_directiveZ
attrs_pathZ	attr_nameZmodule_nameparent_pathZcustom_pathpartsmodulerrr_parse_attrs0


zConfigHandler._parse_attrcsfdd}|S)zReturns parser function to represents value as a list.

        Parses a value applying given methods one after another.

        :param parse_methods:
        :rtype: callable
        cs|}xD]}||}q
W|S)Nr)r&parsedmethod)
parse_methodsrrr
Qs
z1ConfigHandler._get_parser_compound.<locals>.parser)rPrxr
r)rxr_get_parser_compoundHs	z"ConfigHandler._get_parser_compoundcCs:i}|pdd}x$|jD]\}\}}||||<qW|S)zParses section options into a dictionary.

        Optionally applies a given parser to values.

        :param dict section_options:
        :param callable values_parser:
        :rtype: dict
        cSs|S)Nr)rYrrr<lambda>fsz6ConfigHandler._parse_section_to_dict.<locals>.<lambda>)r0)rPr7Z
values_parserr&rW_rYrrr_parse_section_to_dict[s

z$ConfigHandler._parse_section_to_dictcCs@x:|jD].\}\}}y|||<Wq
tk
r6Yq
Xq
WdS)zQParses configuration file section.

        :param dict section_options:
        N)r0r@)r5r7namer{r&rrr
parse_sectionks
zConfigHandler.parse_sectioncCsfx`|jjD]R\}}d}|r$d|}t|d|jddd}|dkrVtd|j|f||qWdS)zTParses configuration file items from one
        or more related sections.

        r.z_%szparse_section%sr/__Nz0Unsupported distribution option section: [%s.%s])r4r0r$r2rr!)r5r6r7Zmethod_postfixZsection_parser_methodrrrr
wszConfigHandler.parse)F)rG)N)N)r;
__module____qualname____doc__r!r>r8propertyr<rFclassmethodrRrZr_rfstaticmethodrarbruryr|r~r
rrrrr-ts(
&
 ,r-csHeZdZdZdddddZdZdfd	d
	ZeddZd
dZ	Z
S)r(r)Zurldescriptionclassifiers	platforms)Z	home_pageZsummaryZ
classifierplatformFNcstt|j|||||_dS)N)superr(r8r*)r5r"r+rr*)r:rrr8szConfigMetadataHandler.__init__cCs8|j}|j}|j}||||||j||||||j|dS)z.Metadata item name to parser function mapping.)rkeywordsZprovidesZrequiresZ	obsoletesrlicenserZlong_descriptionversionZproject_urls)rRrfrZry_parse_version)r5
parse_listZ
parse_file
parse_dictrrrr<s
zConfigMetadataHandler.parserscCs|j|}||kr<|j}tt|tr8td||f|S|j||j}t|rX|}t|t	st
|dr~djtt
|}nd|}|S)zSParses `version` option value.

        :param value:
        :rtype: str

        z7Version loaded from %s does not comply with PEP 440: %s__iter__r/z%s)rfr3rLr
r	rrur*callablerhasattrrdmapstr)r5r&rrrrrs


z$ConfigMetadataHandler._parse_version)FN)r;rrr!r>Zstrict_moder8rr<r
__classcell__rr)r:rr(sr(c@sTeZdZdZeddZddZddZdd	Zd
dZ	dd
Z
ddZddZdS)r'r+cCsL|j}t|jdd}|j}|j}|||||||||||||||j|j|dS)z.Metadata item name to parser function mapping.;)rQ)Zzip_safeZuse_2to3Zinclude_package_datar*Zuse_2to3_fixersZuse_2to3_exclude_fixersZconvert_2to3_doctestsscriptsZeager_resourcesZdependency_linksZnamespace_packagesZinstall_requiresZsetup_requiresZ
tests_requireZpackagesentry_pointsZ
py_modules)rRrr_rZ_parse_packagesrf)r5rZparse_list_semicolonZ
parse_boolrrrrr<s*zConfigOptionsHandler.parserscCsBd}|j|s|j|S|j|jjdi}ddlm}|f|S)zTParses `packages` option value.

        :param value:
        :rtype: list
        zfind:z
packages.findr)
find_packages)r1rRparse_section_packages__findr4r?Z
setuptoolsr)r5r&Zfind_directivefind_kwargsrrrrrs

z$ConfigOptionsHandler._parse_packagescsT|j||j}dddgtfdd|jD}|jd}|dk	rP|d|d<|S)zParses `packages.find` configuration file section.

        To be used in conjunction with _parse_packages().

        :param dict section_options:
        whereincludeexcludecs$g|]\}}|kr|r||fqSrr)rIkv)
valid_keysrrrKszEConfigOptionsHandler.parse_section_packages__find.<locals>.<listcomp>Nr)r|rRr r0r?)r5r7Zsection_datarrr)rrrs


z1ConfigOptionsHandler.parse_section_packages__findcCs|j||j}||d<dS)z`Parses `entry_points` configuration file section.

        :param dict section_options:
        rN)r|rR)r5r7rvrrrparse_section_entry_points%sz/ConfigOptionsHandler.parse_section_entry_pointscCs.|j||j}|jd}|r*||d<|d=|S)N*r.)r|rRr?)r5r7rvrootrrr_parse_package_data-s
z(ConfigOptionsHandler._parse_package_datacCs|j||d<dS)z`Parses `package_data` configuration file section.

        :param dict section_options:
        Zpackage_dataN)r)r5r7rrrparse_section_package_data7sz/ConfigOptionsHandler.parse_section_package_datacCs|j||d<dS)zhParses `exclude_package_data` configuration file section.

        :param dict section_options:
        Zexclude_package_dataN)r)r5r7rrr"parse_section_exclude_package_data>sz7ConfigOptionsHandler.parse_section_exclude_package_datacCs"t|jdd}|j|||d<dS)zbParses `extras_require` configuration file section.

        :param dict section_options:
        r)rQZextras_requireN)rrRr|)r5r7rrrrparse_section_extras_requireFsz1ConfigOptionsHandler.parse_section_extras_requireN)
r;rrr!rr<rrrrrrrrrrrr's
r')FF)F)Z
__future__rrrhrrpcollectionsr	functoolsr	importlibrZdistutils.errorsrrZ#setuptools.extern.packaging.versionr	r
Zsetuptools.extern.sixrrrrobjectr-r(r'rrrr<module>s"
.
M