%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/setuptools/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/setuptools/__pycache__/package_index.cpython-312.pyc

�

T��f=���&�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
ZddlZddlZddlZddlmZddlZddlmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$ddl%m&Z&ddl'm(Z(ddl)m*Z*ddl+m,Z,dd	l-m.Z.ej^d
�Z0ej^dejb�Z2ej^d�Z3ej^d
ejb�jhZ5djm�Z7gd�Z8dZ9dZ:e:jwdjvejx�e��Z=d�Z>d�Z?d�Z@d1d�ZAd1d�ZBd1d�ZCdedfd�ZDd�ZEej^dejb�ZF	eEd��ZGGd�d�ZHGd �d!eH�ZIGd"�d#e�ZJej^d$�j�ZLd%�ZMd&�ZNd2d'�ZOd(�ZPGd)�d*�ZQGd+�d,ej��ZSej�j�fd-�ZVd.�ZWeOe9�eV�ZVd/�ZXd0�ZYy)3z$PyPI and direct package downloading.�N��wraps)�
CHECKOUT_DIST�Distribution�BINARY_DIST�normalize_path�SOURCE_DIST�Environment�find_distributions�	safe_name�safe_version�to_filename�Requirement�DEVELOP_DIST�EGG_DIST�
parse_version)�log)�DistutilsError)�	translate)�Wheel��unique_everseenz^egg=([-A-Za-z0-9_.+!]+)$zhref\s*=\s*['"]?([^'"> ]+)z�<a href="([^"#]+)">([^<]+)</a>\n\s+\(<a (?:title="MD5 hash"\n\s+)href="[^?]+\?:action=show_md5&amp;digest=([0-9a-f]{32})">md5</a>\)z([-+.a-z0-9]{2,}):z.tar.gz .tar.bz2 .tar .zip .tgz)�PackageIndex�distros_for_url�parse_bdist_wininst�interpret_distro_name�z<setuptools/{setuptools.__version__} Python-urllib/{py_major}z{}.{})�py_major�
setuptoolsc�n�	tj|�S#t$r}td|���|�d}~wwxYw)Nz/Not a URL, existing file, or requirement spec: )r�parse�
ValueErrorr)�spec�es  �:/usr/lib/python3/dist-packages/setuptools/package_index.py�parse_requirement_argr&Es>���� � ��&�&�����CG�I�
��	���s��	4�/�4c�8�|j�}d\}}}|jd�ro|jd�r|dd}d}nV|jdd�r
|d	d
}|dd}d}n7|jd�r|dd}d
}n|jdd�r|d	d
}|dd}d
}|||fS)z=Return (base,pyversion) or (None,None) for possible .exe name)NNN�.exez
.win32.exeNi�����win32z	.win32-pyi�i�������z.win-amd64.exei�z	win-amd64z
.win-amd64-pyi��)�lower�endswith�
startswith)�namer+�base�py_ver�plats     r%rrNs���
�J�J�L�E�)��D�&�$��~�~�f���>�>�,�'����:�D��D�
�
�
�k�3�
/��"�R�[�F����:�D��D�
�^�^�,�
-����:�D��D�
�
�
�o�s�
3��"�R�[�F����:�D��D������c�d�tjj|�}|\}}}}}}tjj|j	d�d�}|dk(r6|dk(r1tjj|j	d�d�}d|vr|j	dd�\}}||fS)N�/���zsourceforge.net�download����#�)�urllibr!�urlparse�unquote�split)	�url�parts�scheme�server�path�
parameters�query�fragmentr/s	         r%�egg_info_for_urlrFfs����L�L�!�!�#�&�E�8=�5�F�F�D�*�e�X��<�<����
�
�3��� 3�4�D�
�"�"�t�z�'9��|�|�#�#�D�J�J�s�O�B�$7�8��
�d�{����C��+���h���>�r2c#��K�t|�\}}t|||�D]}|���|rDtj|�}|r,t	||jd�|t��D]}|���yyy�w)zEYield egg or source distribution objects that might be found at a URLr9)�
precedenceN)rF�distros_for_location�EGG_FRAGMENT�matchr�groupr)r>�metadatar/rE�distrKs      r%rrqs}����%�c�*�N�D�(�$�S�$��9����
����"�"�8�,���-��U�[�[��^�X�-��
���
�
���s�A,A.c�&�|jd�r|dd}|jd�rd|vrtj|||�gS|jd�rLd|vrHt|�}|j	�sgSt||j
|jtdz��gS|jd	�r%t|�\}}}|�t||||t|�StD]1}|j|�s�|dt|�}t|||�cSgS)
z:Yield egg or source distribution objects based on basename�.egg.zipNr*z.egg�-z.whlr9)�location�project_name�versionrHr()
r,r�
from_locationr�
is_compatiblerSrTrrrr�
EXTENSIONS�len)rR�basenamerM�wheel�win_baser0�platform�exts        r%rIrIs+������$��C�R�=������ �S�H�_��*�*�8�X�x�H�I�I����� �S�H�_��h����"�"�$��I��!�"�/�/��
�
�#�a�<�
�
�	
����� �%8��%B�"��&�(���(��(�H�f�k�8��
�
�G�����S�!���3�s�8�)�,�H�(��8�X�F�F�G��Ir2c�h�tt|�tjj	|�|�S)zEYield possible egg or source distribution objects based on a filename)rIr�osrBrY)�filenamerMs  r%�distros_for_filenamera�s*����x� �"�'�'�"2�"2�8�"<�h��r2c
#�FK�|jd�}|std�|ddD��rytt|��D]}||ddj	�s�nt|�}t||dj
|d|�dj
||d�|||����y�w)z�Generate the interpretation of a source distro name

    Note: if `location` is a filesystem filename, you should call
    ``pkg_resources.normalize_path()`` on it before passing it to this
    routine!
    rQc3�HK�|]}tjd|����y�w)z	py\d\.\d$N)�rerK)�.0�ps  r%�	<genexpr>z(interpret_distro_name.<locals>.<genexpr>�s����K�A�b�h�h�|�Q�7�K�s� "�Nr9)�
py_versionrHr\)r=�any�rangerX�isdigitr�join)rRrYrMrirHr\r?rfs        r%rr�s�����
�N�N�3��E��#�K��q�r��K�K���3�u�:�
�����8�B�Q�<���!���
��J��
�������r��������q�r��������s
�AB!�AB!c�.��t���fd��}|S)zs
    Wrap a function returning an iterable such that the resulting iterable
    only ever yields unique items.
    c�&��t�|i|���S�Nr)�args�kwargs�funcs  �r%�wrapperzunique_values.<locals>.wrapper�s����t�T�4�V�4�5�5r2r)rsrts` r%�
unique_valuesru�s"����4�[�6��6��Nr2z3<([^>]*\srel\s{0,10}=\s{0,10}['"]?([^'" >]+)[^>]*)>c
#�K�tj|�D]�}|j�\}}tt	t
j|j�jd���}d|vsd|vs�_tj|�D]<}tjj|t|jd������>��dD]l}|j|�}|dk7s�tj!||�}|s�3tjj|t|jd������ny�w)zEFind rel="homepage" and rel="download" links in `page`, yielding URLs�,�homepager6r9)z
<th>Home Pagez<th>Download URLr5N)�REL�finditer�groups�set�map�str�stripr+r=�HREFr:r!�urljoin�
htmldecoderL�find�search)r>�pagerK�tag�rel�rels�poss       r%�find_external_linksr��s�������d�#�L���<�<�>���S��3�s�y�y�#�)�)�+�"3�"3�C�"8�9�:������t�!3����s�+�
L���l�l�*�*�3�
�5�;�;�q�>�0J�K�K�
L�	L�5�L���i�i��n���"�9��K�K��c�*�E���l�l�*�*�3�
�5�;�;�q�>�0J�K�K�L�s�A4D?�7A1D?�)D?�=D?c�"�eZdZdZd�Zd�Zd�Zy)�ContentCheckerzP
    A null content checker that defines the interface for checking content
    c��y)z3
        Feed a block of data to the hash.
        N���self�blocks  r%�feedzContentChecker.feed�s��	r2c��y)zC
        Check the hash. Return False if validation fails.
        Tr��r�s r%�is_validzContentChecker.is_valid�s��r2c��y)zu
        Call reporter with information about the checker (hash name)
        substituted into the template.
        Nr�)r��reporter�templates   r%�reportzContentChecker.reports��
	r2N)�__name__�
__module__�__qualname__�__doc__r�r�r�r�r2r%r�r��s�����r2r�c�X�eZdZejd�Zd�Zed��Zd�Z	d�Z
d�Zy)�HashCheckerzK(?P<hash_name>sha1|sha224|sha384|sha256|sha512|md5)=(?P<expected>[a-f0-9]+)c�T�||_tj|�|_||_yrp)�	hash_name�hashlib�new�hash�expected)r�r�r�s   r%�__init__zHashChecker.__init__s ��"����K�K�	�*��	� ��
r2c���tjj|�d}|s
t�S|jj|�}|s
t�S|di|j
���S)z5Construct a (possibly null) ContentChecker from a URLr5r�)r:r!r;r��patternr��	groupdict)�clsr>rErKs    r%�from_urlzHashChecker.from_urls^���<�<�(�(��-�b�1���!�#�#����"�"�8�,���!�#�#��'�U�_�_�&�'�'r2c�:�|jj|�yrp)r��updater�s  r%r�zHashChecker.feed s���	�	����r2c�P�|jj�|jk(Srp)r��	hexdigestr�r�s r%r�zHashChecker.is_valid#s���y�y�"�"�$��
�
�5�5r2c�0�||jz}||�Srp)r�)r�r�r��msgs    r%r�zHashChecker.report&s������'����}�r2N)r�r�r�rd�compiler�r��classmethodr�r�r�r�r�r2r%r�r�
s?���b�j�j�	#��G�
!�
�(��(� �6�r2r�c�0��eZdZdZ				d&�fd�	Z�fd�Zd'd�Zd'd�Zd'd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d(d�Zd
�Zd(�fd�	Zd�Zd�Zd�Zd�Zd�Z				d)d�Zd*d�Zd�ZdZd�Zd�Zd(d�Zd�Zed��Zd�Z d�Z!d�Z"d �Z#d!�Z$ed"��Z%d#�Z&d$�Z'd%�Z(�xZ)S)+rz;A distribution index that scans web pages for download URLsc�V��t�|�|i|��|dd|jd�z|_i|_i|_i|_tjdjtt|���j|_
g|_tj j"|_y)Nr4�|)�superr�r,�	index_url�scanned_urls�fetched_urls�
package_pagesrdr�rmr}rrK�allows�to_scanr:�request�urlopen�opener)r�r��hosts�	ca_bundle�
verify_sslrq�kw�	__class__s       �r%r�zPackageIndex.__init__.s����	���$�%�"�%�"�S�)F�y�/A�/A�#�/F�+F�%G�G�������������j�j����#�i��*?�!@�A�G�G�������n�n�,�,��r2c�l��	t|j�t�|�|�S#t$rYywxYwrp)rrT�	Exceptionr��add)r�rNr�s  �r%r�zPackageIndex.add@s9���	��$�,�,�'��w�{�4� � ���	��	�s�'�	3�3c	���||jvr|syd|j|<t|�s|j|�ytt	|��}|r$|j|�sy|j
d|�|s|r||jvr tt|j|��y|j|�sd|j|<y|jd|�d|j|<d}|j|||z�}|�yt|tjj�r-|j dk(r|jd|j"z�d|j|j$<d|j&j)d	d
�j+�vr|j-�y|j$}|j/�}t|t0�sXt|tjj�rd}n|j&j3d�xsd}|j5|d
�}|j-�t6j9|�D]K}	tj:j=|t?|	jAd���}
|jC|
��M|jE|jF�r$tI|dd�dk7r|jK||�}yyy)z<Evaluate a URL as a possible download, and maybe retrieve itNTzFound link: %sz
Reading %sz<Download error on %s: %%s -- Some packages may not be found!i�zAuthentication error: %s�html�content-type�zlatin-1�charset�ignorer9�code�)&r��
URL_SCHEME�process_filename�listr�url_ok�debugr�r}r��info�open_url�
isinstancer:�error�	HTTPErrorr�r�r>�headers�getr+�close�readr~�	get_param�decoder�rzr!r�r�rL�process_urlr-r��getattr�
process_index)r�r>�retrieve�dists�tmpl�fr/r�r�rK�links           r%r�zPackageIndex.process_urlIsV���$�#�#�#�H��!%����#���#���!�!�#�&�����-�.�E���{�{�3�'���
�
�+�S�1���C�4�+<�+<�$<���T�X�X�u�%�&���{�{�3��%)�D���c�"���	�	�,��$�!%����#��M���M�M�#�t�c�z�*���9���a����/�/�0�Q�V�V�s�]��I�I�0�1�5�5�8�9�#'����!�%�%� �������~�r�:�@�@�B�B�
�G�G�I���u�u���v�v�x���$��$��!�V�\�\�3�3�4�#���)�)�-�-�i�8�E�I���;�;�w��1�D�	���	��]�]�4�(�	#�E��<�<�'�'��j����Q��.H�I�D����T�"�	#��>�>�$�.�.�)�g�a���.F�#�.M��%�%�c�4�0�D�/N�)r2c��tjj|�s|jd|�ytjj	|�rk|sitjj|�}tj|�D]2}|jtjj||�d��4t|�}|r2|jd|�tt|j|��yy)Nz
Not found: %sTz	Found: %s)r_rB�exists�warn�isdir�realpath�listdirr�rmrar�r�r}r�)r��fn�nestedrB�itemr�s      r%r�zPackageIndex.process_filename~s����w�w�~�~�b�!��I�I�o�r�*��
�7�7�=�=���V��7�7�#�#�B�'�D��
�
�4�(�
F���%�%�b�g�g�l�l�4��&>��E�
F�%�R�(����J�J�{�B�'���T�X�X�u�%�&�r2c��t|�}|xr"|jd�j�dk(}|s1|jtj
j
|�d�ryd}|rt||z��|j||�y)Nr9�fileTz�
Note: Bypassing %s (disallowed host; see https://setuptools.pypa.io/en/latest/deprecated/easy_install.html#restricting-downloads-with-allow-hosts for details).
)	r�rLr+r�r:r!r;rr�)r�r>�fatal�s�is_filer�s      r%r�zPackageIndex.url_ok�s}���s�O���4�����
�(�(�*�f�4���d�k�k�&�,�,�"7�"7��"<�Q�"?�@��
W�	�
� ��s��+�+��I�I�c�3�r2c��ttjj|�}d�|D�}t	tj|j|��y)Nc3�zK�|]3}tj|�D]}|jd�r||f����5y�w)z	.egg-linkN)r_r�r,)rerB�entrys   r%rgz.PackageIndex.scan_egg_links.<locals>.<genexpr>�sF����
�����D�)�
���~�~�k�*��5�M�
��
�s�9;)�filterr_rBr�r��	itertools�starmap�
scan_egg_link)r��search_path�dirs�	egg_linkss    r%�scan_egg_linkszPackageIndex.scan_egg_links�sB���b�g�g�m�m�[�1��
��
�	�	
�Y�
�
�t�1�1�9�
=�>r2c
���ttjj||��5}t	tdt
tj|���}ddd�t�dk7ry|\}}ttjj||��D]C}tjj|g|���|_t|_
|j|��Ey#1swY��xYw)Nrh)�openr_rBrmr�r�r}r~rrXrrRr	rHr�)r�rBr��	raw_lines�lines�egg_path�
setup_pathrNs        r%r�zPackageIndex.scan_egg_link�s���
�"�'�'�,�,�t�U�+�
,�	B�	����c�#�)�)�Y�&?�@�A�E�	B��u�:��?��$���*�&�r�w�w�|�|�D�(�'C�D�	�D��G�G�L�L��6��6�D�M�)�D�O��H�H�T�N�	�	B�	B�s�.C$�$C-c	���d}|j|j�s|Stttj
j|t|j�djd���}t|�dk7sd|dvr|St|d�}t|d�}d|jj|j�i�|<t|�t|�fS)N)NNr4rhr8r9rT)r-r�r�r}r:r!r<rXr=rr
r��
setdefaultr+r)r�r��NO_MATCH_SENTINELr?�pkg�vers      r%�_scanzPackageIndex._scan�s���&�����t�~�~�.�$�$��S����-�-�t�C����4G�4I�/J�/P�/P�QT�/U�V�W���u�:��?�c�U�1�X�o�$�$���a��!���5��8�$��?C����%�%�c�i�i�k�2�6�t�<��3���S�!1�1�1r2c��tj|�D]J}	|jtjj|t
|jd�����L|j|�\}}|syt||�D]S}t|�\}}|jd�r!|s|r|d|�d|��z
}n|j|�|j|��Utjd�|�S#t$rY��wxYw)z#Process the contents of a PyPI pager9r��.pyz#egg=rQc�.�d|jddd�zS)Nz<a href="%s#md5=%s">%s</a>r9�rh)rL)�ms r%�<lambda>z,PackageIndex.process_index.<locals>.<lambda>�s��2�Q�W�W�Q��1�5E�E�r2)r�rzr
r:r!r�r�rLr"r�rFr,�need_version_info�scan_url�PYPI_MD5�sub)	r�r>r�rKrr�new_urlr/�frags	         r%r�zPackageIndex.process_index�s����]�]�4�(�	�E�
��
�
�6�<�<�/�/��Z����A��5O�P�Q�	��:�:�c�?���S���+�3��5�	#�G�)�'�2�J�D�$��}�}�U�#�D���s�C�8�8�G��*�*�3�/��M�M�'�"�	#��|�|�E�t�
�	
��%�
��
�s�AC3�3	C?�>C?c�(�|jd|�y)NzPPage at %s links to .py file(s) without version info; an index scan is required.)�scan_all�r�r>s  r%rzPackageIndex.need_version_info�s���
�
�
 ��	
r2c��|j|jvr&|r|j|g|���|jd�|j	|j�y)Nz6Scanning index of all packages (this may take a while))r�r�r�r�r�r�r�rqs   r%rzPackageIndex.scan_all�sG���>�>��!2�!2�2����	�	�#�%��%��I�I�N�O��
�
�d�n�n�%r2c���|j|j|jzdz�|jj	|j
�s+|j|j|jzdz�|jj	|j
�s|j|�t|jj	|j
d��D]}|j|��y)Nr4r�)	rr��unsafe_namer�r��keyrS�not_found_in_indexr�)r��requirementr>s   r%�
find_packageszPackageIndex.find_packages�s����
�
�d�n�n�{�'>�'>�>��D�E��!�!�%�%�k�o�o�6��M�M�$�.�.�;�+C�+C�C�c�I�J��!�!�%�%�k�o�o�6��#�#�K�0���*�*�.�.�{����C�D�	�C��M�M�#��	r2c����|j�|j|�||jD]}||vr|cS|jd||��tt
|�||�S)Nz%s does not match %s)�prescanr$r!r�r�r�obtain)r�r#�	installerrNr�s    �r%r'zPackageIndex.obtainsh����������;�'�����)�	B�D��{�"����J�J�-�{�D�A�	B��\�4�/��Y�G�Gr2c�0�|j|jd|z�|j�sg|j�t	j
|�t
|jj�dtjj|��d���y)z-
        checker is a ContentChecker
        zValidating %%s checksum for %sz validation failed for z; possible download problem?N)r�r�r�r�r_�unlinkrr�r.rBrY)r��checkerr`�tfps    r%�
check_hashzPackageIndex.check_hash
su��	���t�z�z�#C�h�#N�O����!��I�I�K��I�I�h�� ��<�<�$�$�b�g�g�&6�&6�x�&@�B��
�"r2c���|D]k}|j�0t|�r%|jd�stt	|��r|j|��Q|jj
|��my)z;Add `urls` to the list that will be prescanned for searchesN�file:)r�r�r-r�rr�append)r��urlsr>s   r%�add_find_linkszPackageIndex.add_find_linkss]���	)�C����$�!�#���>�>�'�*����,�-��
�
�c�"����#�#�C�(�	)r2c�|�|jr)tt|j|j��d|_y)z7Scan urls scheduled for prescanning (e.g. --find-links)N)r�r�r}rr�s r%r&zPackageIndex.prescan's'���<�<���T�]�]�D�L�L�1�2���r2c��||jr|jd}}n|jd}}|||j�|j	�y)Nz#Couldn't retrieve index page for %rz3Couldn't find index page for %r (maybe misspelled?))r!r�r�r r)r�r#�methr�s    r%r"zPackageIndex.not_found_in_index-sJ������ ��	�	�#H�#�D��	�	�E��D�	
�S�+�)�)�*��
�
�r2c�Z�t|t�st|�}|rF|j||�}t	|�\}}|jd�r|j
|||�}|Stjj|�r|St|�}t|j||�dd�S)aLocate and/or download `spec` to `tmpdir`, returning a local path

        `spec` may be a ``Requirement`` object, or a string containing a URL,
        an existing local filename, or a project/version requirement spec
        (i.e. the string form of a ``Requirement`` object).  If it is the URL
        of a .py file with an unambiguous ``#egg=name-version`` tag (i.e., one
        that escapes ``-`` as ``_`` throughout), a trivial ``setup.py`` is
        automatically created alongside the downloaded file.

        If `spec` is a ``Requirement`` object or a string containing a
        project/version requirement spec, this method returns the location of
        a matching distribution (possibly after downloading it to `tmpdir`).
        If `spec` is a locally existing file or directory name, it is simply
        returned unchanged.  If `spec` is a URL, it is downloaded to a subpath
        of `tmpdir`, and the local filename is returned.  Various errors may be
        raised if a problem occurs during downloading.
        rrRN)
r�rr��
_download_urlrFr,�	gen_setupr_rBr�r&r��fetch_distribution)r�r#�tmpdirr@�foundr/rEs       r%r6zPackageIndex.download8s���$�$��,���%�F���*�*�4��8��!1�$�!7���h��=�=��'� �N�N�5�(�F�C�E���������%���,�T�2���t�.�.�t�V�<�j�$�O�Or2c�������	��jd|�i�	d}d	���	��fd�	}|r)�j��j|�||�}|s|�	|||�}|�$�j��j�||�}|�|s�j|�||�}|��j	d�xrdxsd|�y�jd|�|j|j��S)
a|Obtain a distribution suitable for fulfilling `requirement`

        `requirement` must be a ``pkg_resources.Requirement`` instance.
        If necessary, or if the `force_scan` flag is set, the requirement is
        searched for in the (online) package index as well as the locally
        installed packages.  If a distribution matching `requirement` is found,
        the returned distribution's ``location`` is the value you would have
        gotten from calling the ``download()`` method with the matching
        distribution's URL or filename.  If no matching distribution is found,
        ``None`` is returned.

        If the `source` flag is set, only source distributions and source
        checkout links will be considered.  Unless the `develop_ok` flag is
        set, development and system eggs (i.e., those using the ``.egg-info``
        format) will be ignored.
        zSearching for %sNc�z��|��}||jD]�}|jtk(r�s|�vr�jd|�d�|<�4||vxr|jtkxs�}|s�U�j|j�	�}||_tjj|j�s��|cSy)Nz&Skipping development or system egg: %sr9)r!rHrr�r	r6rR�download_locationr_rBr�)
�req�envrN�test�loc�
develop_okr��skipped�sourcer:s
     �����r%r�z-PackageIndex.fetch_distribution.<locals>.findxs�����{����C�G�G��
$���?�?�l�2�:��7�*��	�	�D� ��)*���
���s�{�U����;�(F�(T�f�*����-�-��
�
�v�>�C�-0�D�*��w�w�~�~�d�&<�&<�=�#��
$r2z:No local packages or working download links found for %s%sza source distribution of r�zBest match: %s)rRrp)r�r&r$r�r��cloner>)
r�r#r:�
force_scanrErC�local_indexrNr�rDs
` ` ``   @r%r9zPackageIndex.fetch_distributionZs����4	
�	�	�$�k�2�����	$�	$�,��L�L�N����{�+���$�D���/���[�1�D��<��|�|�'�������$�D��<�
����{�+���$�D��<��I�I�L��7�7�=�2��
�
�I�I�&��-��:�:�t�'=�'=�:�>�>r2c�H�|j||||�}|�|jSy)a3Obtain a file suitable for fulfilling `requirement`

        DEPRECATED; use the ``fetch_distribution()`` method now instead.  For
        backward compatibility, this routine is identical but returns the
        ``location`` of the downloaded distribution instead of a distribution
        object.
        N)r9rR)r�r#r:rGrErNs      r%�fetchzPackageIndex.fetch�s-���&�&�{�F�J��O�����=�=� �r2c��tj|�}|xr6t||jd�d�D�cgc]}|jr|��c}xsg}t|�dk(�rBtjj|�}tjj|�|k7rwtjj||�}tjj|�r tjj||�stj||�|}ttjj|d�d�5}	|	j!d|dj"�d|dj�dtjj%|�d�d��ddd�|S|rt'd	|�d
|����t'd��cc}w#1swY|SxYw)Nr9zsetup.py�wz(from setuptools import setup
setup(name=rz
, version=z, py_modules=[z])
z9Can't unambiguously interpret project/version identifier zI; any dashes in the name or version should be escaped using underscores. zpCan't process plain .py files without an '#egg=name-version' suffix to enable automatic setup script generation.)rJrKrrLrTrXr_rBrY�dirnamermr��samefile�shutil�copy2r�writerS�splitextr)
r�r`rEr:rK�dr�rY�dstr�s
          r%r8zPackageIndex.gen_setup�s����"�"�8�,���
�/�x����Q���N����9�9���
��	��u�:��?��w�w�'�'��1�H��w�w���x�(�F�2��g�g�l�l�6�8�4�������s�+����0@�0@��3�0O��L�L��3�/�"�H��b�g�g�l�l�6�:�6��<�	
���
�
��a��-�-��a��(�(����(�(��2�1�5���	
��O�
� �&.�u�6��
�!�G��
��K�$	
��O�s�G�AG�Gi c�>�|jd|�d}	tj|�}|j|�}t	|t
jj�r(td|�d|j�d|j����|j�}d}|j}d}d|vr?|jd�}	ttt|	��}|j!|||||�t#|d	�5}
	|j%|�}|r=|j'|�|
j)|�|d
z
}|j!|||||�nn�R|j+|||
�ddd�||r|j-�SS#1swY�xYw#|r|j-�wwxYw)NzDownloading %szCan't download �: � rr5zcontent-lengthzContent-Length�wbr9)r�r�r�r�r�r:r�r�rr�r��dl_blocksize�get_all�maxr}�int�
reporthookrr�r�rQr-r�)r�r>r`�fpr+r��blocknum�bs�size�sizesr,r�s            r%�_download_tozPackageIndex._download_to�sv���	�	�"�C�(�
��	�!�*�*�3�/�G����s�#�B��"�f�l�l�4�4�5�$�25�r�w�w����G����g�g�i�G��H��"�"�B��D��7�*����(8�9���3�s�E�?�+������X�x��T�B��h��%�

8����G�G�B�K�E�����U�+��	�	�%�(� �A�
������X�x��T�J��������3�7�

8������
��

8�

8������
��s%�C!F�7A'E;�	F�;F�F�Fc��yrpr�)r�r>r`r_�blksizeras      r%r]zPackageIndex.reporthook
s��r2c	��|jd�rt|�S	t||j�S#tt
jjf$rh}dj|jD�cgc]
}t|���ncc}wc}�}|r|j||�nt|�d|���|�Yd}~yd}~wtjj$r}|cYd}~Sd}~wtjj $rE}|r|j||j"�ntd|�d|j"���|�Yd}~yd}~wt
jj$$rD}|r|j||j&�nt|�d|j&���|�Yd}~yd}~wt
jj(t*jf$r1}|r|j||�ntd|�d|���|�Yd}~yd}~wwxYw)Nr/rWzDownload error for rVz7 returned a bad status line. The server might be down, )r-�
local_open�open_with_authr�r"�http�client�
InvalidURLrmrqr~r�rr:r�r��URLError�reason�
BadStatusLine�line�
HTTPException�socket)r�r>�warning�v�argr�s      r%r�zPackageIndex.open_urls����>�>�'�"��c�?�"�	T�!�#�t�{�{�3�3���D�K�K�2�2�3�	B��(�(����7��C��H�7��7�8�C���	�	�'�3�'�$��S�%9�:��A�(���|�|�%�%�	��H���|�|�$�$�	���	�	�'�1�8�8�,�$�36����A����-��
�{�{�(�(�	���	�	�'�1�6�6�*�$�"%�q�v�v�/����+�����)�)�6�<�<�8�	T���	�	�'�1�%�$�C��%K�L�RS�S�&��	T�sW�4�#H�B:�0B
�3B:�: H�C!�H�! H�;E� H�!:F � 0H�'G<�<Hc�6�t|�\}}|r,d|vr*|jdd�jdd�}d|vr�'nd}|jd�r|dd}tjj||�}|j
||�xs|j||�S)Nz..�.�\�_�__downloaded__rPr*)rF�replacer,r_rBrm�
_download_vcs�_download_other)r�r>r:r.rEr`s      r%r7zPackageIndex._download_url0s���*�#�.���h���$�,��|�|�D�#�.�6�6�t�S�A���$�,�$�D��=�=��$����9�D��7�7�<�<���-���!�!�#�x�0�W�D�4H�4H��h�4W�Wr2c���tjj|�j}|j	d�\}}}tddgdgt
|�zz�}tt|h|z�d�S)a

        >>> rvcs = PackageIndex._resolve_vcs
        >>> rvcs('git+http://foo/bar')
        'git'
        >>> rvcs('hg+https://foo/bar')
        'hg'
        >>> rvcs('git:myhost')
        'git'
        >>> rvcs('hg:myhost')
        >>> rvcs('http://foo/bar')
        �+�svn�git�hgN)	r:r!�urlsplitr@�	partitionr|�bool�next�iter)r>r@�pre�sep�post�alloweds      r%�_resolve_vcszPackageIndex._resolve_vcsAsj�����&�&�s�+�2�2���)�)�#�.���S�$��u�e�n��v��S�	�'9�9�:���D�#����)�4�0�0r2c��|j|�}|sy|dk(rtd|����|jd�\}}}|j|�\}}|j	d|�d|�d|���tj|dd||g�t|d	|d
d|g|d|dd	d
|dg��}|�,|j	d|���tj||�|S)Nrz/Invalid config, SVN download is not supported: r8zDoing z clone from z to rFz--quietz-C�checkoutz--cwd�upz-rz-q)r�r�z
Checking out )r�rr��_vcs_split_rev_from_urlr��
subprocess�
check_call�dict)r�r>�
spec_filename�vcsr`rx�rev�co_commandss        r%r{zPackageIndex._download_vcsTs�������$�����%�<� �A�#��G��
�'�0�0��5���!�Q��/�/��4���S��	�	�F�3�%�|�C�5��X�J�?�@����s�G�Y��X�F�G���d�H�j�)�S�A��W�h��d�D�#�t�D�
���?��I�I�
�c�U�+�,��!�!�+�c�"2�3��r2c�2�tjj|�j}|dk(rFtjjtjj
|�j�S|j|d�|j||�S)Nr�T)
r:r!r�r@r��url2pathnamer;rBr��_attempt_download)r�r>r`r@s    r%r|zPackageIndex._download_othermso�����&�&�s�+�2�2���V���>�>�.�.�v�|�|�/D�/D�S�/I�/N�/N�O�O����C����%�%�c�8�4�4r2c�(�|j|d�y)NT)r�rs  r%rzPackageIndex.scan_urlus������d�#r2c��|j||�}d|jdd�j�vr|j|||�S|S)Nr�r�r�)rcr�r+�_invalid_download_html)r�r>r`r�s    r%r�zPackageIndex._attempt_downloadxsJ���#�#�C��2���W�[�[���4�:�:�<�<��.�.�s�G�X�F�F��Or2c�H�tj|�td|����)NzUnexpected HTML page found at )r_r*r)r�r>r�r`s    r%r�z#PackageIndex._invalid_download_htmls!��
�	�	�(���=�c�U�C�D�Dr2c�L�tjj|�}|jj	dd�d}|j
j
d�\}}}|jd�\}}}|r||fn|df\}}	|j||d��j�}
|
|	fS)	a�
        Given a possible VCS URL, return a clean URL and resolved revision if any.

        >>> vsrfu = PackageIndex._vcs_split_rev_from_url
        >>> vsrfu('git+https://github.com/pypa/setuptools@v69.0.0#egg-info=setuptools')
        ('https://github.com/pypa/setuptools', 'v69.0.0')
        >>> vsrfu('git+https://github.com/pypa/setuptools#egg-info=setuptools')
        ('https://github.com/pypa/setuptools', None)
        >>> vsrfu('http://foo/bar')
        ('http://foo/bar', None)
        r~r9r5r8�@Nr�)r@rBrE)
r:r!r�r@r=rBr��
rpartition�_replace�geturl)r>r?�clean_scheme�no_fragment_pathrxr�r�r��
clean_pathr��resolveds           r%r�z$PackageIndex._vcs_split_rev_from_url�s������%�%�c�*���|�|�)�)�#�q�1�"�5��"'���!5�!5�c�!:���!�Q�)�4�4�S�9���S�$�),�3��+�4��,��
�C��>�>����	"�
�
�&�(�	���}�r2c�0�tj|g|���yrp)rr�rs   r%r�zPackageIndex.debug�s���	�	�#���r2c�0�tj|g|���yrp)rr�rs   r%r�zPackageIndex.info���������t�r2c�0�tj|g|���yrp)rr�rs   r%r�zPackageIndex.warn�r�r2)zhttps://pypi.org/simple/)�*NT)Frp)FFFN)FF)*r�r�r�r�r�r�r�r�r�rr�r
r�rrr$r'r-r2r&r"r6r9rJr8rYrcr]r�r7�staticmethodr�r{r|rr�r�r�r�r�r��
__classcell__�r�s@r%rr+s���E�-����-�$!�31�j'� 
 �?�� 2� 
�:
�&�
�H��
)��	� P�L����M?�^�,�\�L�"�H
� T�DX�"�1��1�$�25�$��E�����>��r2rz!&(#(\d+|x[\da-fA-F]+)|[\w.:-]+);?c�N�|jd�}tj|�S)Nr)rLr��unescape)rK�whats  r%�
decode_entityr��s���;�;�q�>�D��=�=���r2c�"�tt|�S)a
    Decode HTML entities in the given text.

    >>> htmldecode(
    ...     'https://../package_name-0.1.2.tar.gz'
    ...     '?tokena=A&amp;tokenb=B">package_name-0.1.2.tar.gz')
    'https://../package_name-0.1.2.tar.gz?tokena=A&tokenb=B">package_name-0.1.2.tar.gz'
    )�
entity_subr�)�texts r%r�r��s���m�T�*�*r2c����fd�}|S)Nc������fd�}|S)Nc����tj�}tj��	�|i|��tj|�S#tj|�wxYwrp)rq�getdefaulttimeout�setdefaulttimeout)rqrr�old_timeoutrs�timeouts   ��r%�_socket_timeoutz@socket_timeout.<locals>._socket_timeout.<locals>._socket_timeout�sN��� �2�2�4�K��$�$�W�-�
6��T�,�V�,��(�(��5���(�(��5�s�A	�	A r�)rsr�r�s` �r%r�z'socket_timeout.<locals>._socket_timeout�s���	6��r2r�)r�r�s` r%�socket_timeoutr��s���	��r2c���tjj|�}|j�}t	j
|�}|j
�}|jdd�S)a9
    Encode auth from a URL suitable for an HTTP header.
    >>> str(_encode_auth('username%3Apassword'))
    'dXNlcm5hbWU6cGFzc3dvcmQ='

    Long auth strings should not cause a newline to be inserted.
    >>> long_auth = 'username:' + 'password'*10
    >>> chr(10) in str(_encode_auth(long_auth))
    False
    �
r�)r:r!r<�encode�base64�	b64encoder�rz)�auth�auth_s�
auth_bytes�
encoded_bytes�encodeds     r%�_encode_authr��sR���\�\�
!�
!�$�
'�F�����J��$�$�Z�0�M��"�"�$�G��?�?�4��$�$r2c�"�eZdZdZd�Zd�Zd�Zy)�
Credentialz:
    A username/password pair. Use like a namedtuple.
    c� �||_||_yrp��username�password)r�r�r�s   r%r�zCredential.__init__�s�� ��
� ��
r2c#�DK�|j��|j��y�wrpr�r�s r%�__iter__zCredential.__iter__�s�����m�m���m�m��s� c��dt|�zS)Nz%(username)s:%(password)s)�varsr�s r%�__str__zCredential.__str__�s��*�T�$�Z�7�7r2N)r�r�r�r�r�r�r�r�r2r%r�r��s���!��8r2r�c�:��eZdZ�fd�Zed��Zd�Zd�Z�xZS)�
PyPIConfigc�0��tjgd�d�}t�|�
|�tj
j
tj
jd�d�}tj
j|�r|j|�yy)z%
        Load from ~/.pypirc
        )r�r��
repositoryr��~z.pypircN)
r��fromkeysr�r�r_rBrm�
expanduserr�r�)r��defaults�rcr�s   �r%r�zPyPIConfig.__init__�sf����=�=�!G��L��
����"�
�W�W�\�\�"�'�'�,�,�S�1�9�
=��
�7�7�>�>�"���I�I�b�M�r2c���|j�D�cgc]$}|j|d�j�r|��&}}tt	|j
|��Scc}w)Nr�)�sectionsr�rr�r}�_get_repo_cred)r��section�sections_with_repositoriess   r%�creds_by_repositoryzPyPIConfig.creds_by_repositorys_�� �=�=�?�&
���x�x���.�4�4�6�
�&
�"�&
��C��+�+�-G�H�I�I��
&
s�)Ac���|j|d�j�}|t|j|d�j�|j|d�j��fS)Nr�r�r�)r�rr�)r�r��repos   r%r�zPyPIConfig._get_repo_creds]���x�x���.�4�4�6���Z��H�H�W�j�)�/�/�1��H�H�W�j�)�/�/�1�
�
�	
r2c�r�|jj�D]\}}|j|�s�|cSy)z�
        If the URL indicated appears to be a repository defined in this
        config, return the credential for that repository.
        N)r��itemsr-)r�r>r��creds    r%�find_credentialzPyPIConfig.find_credentials8��
!%� 8� 8� >� >� @�	��J���~�~�j�)���	r2)	r�r�r�r��propertyr�r�r�r�r�s@r%r�r��s(���	��J��J�
�r2r�c��tjj|�}|\}}}}}}|jd�rtj
j
d��|dvrt|�\}	}
nd}	|	sJt�j|�}|r/t|�}	|j|f}tjdg|���|	rgdt|	�z}	|
||||f}
tjj|
�}tj j#|�}|j%d|	�ntj j#|�}|j%dt&�||�}|	rftjj|j(�\}}}}}}||k(r1|
k(r,||||||f}
tjj|
�|_|S)	z4Open a urllib2 request, handling HTTP authentication�:znonnumeric port: '')ri�httpsNz*Authenticating as %s for %s (from .pypirc)zBasic �
Authorizationz
User-Agent)r:r!r;r,rirjrk�
_splituserr�r�r~r�rr�r��
urlunparser��Request�
add_header�
user_agentr>)r>r��parsedr@�netlocrB�paramsrDrr��addressr�r�r?rr�r^�s2�h2�path2�param2�query2�frag2s                       r%rhrhs����\�\�
"�
"�3�
'�F�06�-�F�F�D�&�%�����s���k�k�$�$�%:�;�;�
�"�"�"�6�*�
��g�����|�+�+�C�0����t�9�D��=�=�#�%�D��H�H�A�I�D�I���,�t�,�,�����v�u�d�:���,�,�)�)�%�0���.�.�(�(��1�����?�D�1��.�.�(�(��-�����|�Z�0�	���B��06�|�|�/D�/D�R�V�V�/L�,��B��v�v�u�
��<�B�'�M����v�v�u�<�E��\�\�,�,�U�3�B�F�
�Ir2c�@�|jd�\}}}|r||fSd|fS)zNsplituser('user[:passwd]@host[:port]')
    --> 'user[:passwd]', 'host[:port]'.r�N)r�)�host�user�delims   r%r�r�Ns0������,��D�%���D�d�*�*�t�d�*�*r2c��|Srpr�)r>s r%�
fix_sf_urlrYs���Jr2c��tjj|�\}}}}}}tjj	|�}t
jj|�rtjj|�S|jd�r�t
jj|�r�g}tj|�D]�}	t
jj||	�}
|	dk(r't|
d�5}|j�}ddd�nkt
jj|
�r|	dz
}	|jdj!|	�����d}
|
j!|dj|��	�}d
\}}nd\}}}dd
i}t#j$�}tj&j)|||||�S#1swY��xYw)z7Read a local path, with special support for directoriesr4z
index.html�rNz<a href="{name}">{name}</a>)r.zB<html><head><title>{url}</title></head><body>{files}</body></html>r�)r>�files)���OK)r�zPath not foundz	Not foundr�z	text/html)r:r!r;r�r�r_rB�isfiler�r,r�r�rmrr�r0�format�io�StringIOr�r�)r>r@rArB�paramrDrr`rr��filepathr^�bodyr��status�messager��body_streams                  r%rgrg]s���/5�|�|�/D�/D�S�/I�,�F�F�D�%����~�~�*�*�4�0�H�	�w�w�~�~�h���~�~�%�%�c�*�*�	
���s�	����
�
�h� 7������H�%�
	@�A��w�w�|�|�H�a�0�H��L� ��(�C�(�%�B��7�7�9�D�%�������x�(��S����L�L�6�=�=�1�=�E�F�
	@�X�
��;�;�3�d�i�i��.>�;�?�D�#���� B������{�+�G��+�+�d�#�K��<�<�!�!�#�v�w���M�M�#%�%�s�?G
�
G	rp)r)Zr��sysr�r_rdrrOrqr�r�r��configparserr��http.clientri�urllib.parser:�urllib.request�urllib.error�	functoolsrr�
pkg_resourcesrrrrr	r
rrr
rrrrr�	distutilsr�distutils.errorsr�fnmatchr�setuptools.wheelr� setuptools.extern.more_itertoolsrr�rJ�Ir�rrKr�r=rW�__all__�_SOCKET_TIMEOUT�_tmplr
�version_infor�r&rrFrrIrarruryr�r�r�rrr�r�r�r�r�r��RawConfigParserr�r�r�rhr�rrgr�r2r%�<module>r&s��*�
��	�	�	�
�
�
��������������� �+��"�<��r�z�z�6�7���r�z�z�3�R�T�T�:���2�:�:�J����R�Z�Z�,�b�d�d�
3�
9�
9�
�
.�
4�
4�
6�
�����F��
�\�\�
�W�^�^�S�-�-�
.�:���
�
��0�� �F�.2�k�TX��D
��b�j�j�K�R�T�T�R���
�L��L�$��2�.��B	�;�	�H�R�Z�Z�<�
=�
A�
A�
��
	+��%�*8�8�"$��-�-�$�N &�~�~�5�5�+�^+�1���0��@���Nr2

Zerion Mini Shell 1.0