403Webshell
Server IP : 127.0.0.1  /  Your IP : 216.73.216.109
Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10
System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64
User : SERVERWEB ( 0)
PHP Version : 8.1.10
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : OFF |  Perl : OFF |  Python : OFF |  Sudo : OFF |  Pkexec : OFF
Directory :  C:/cygwin64/lib/python3.9/site-packages/setuptools/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/lib/python3.9/site-packages/setuptools/__pycache__/package_index.cpython-39.opt-1.pyc
a

��e��@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZ
ddlZddlZddlZddlmZddlZddlmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#ddl$m%Z%ddl&m'Z'ddl(m)Z)ddl*m+Z+dd	l,m-Z-e�.d
�Z/e�.dej0�Z1e�.d�Z2e�.d
ej0�j3Z4d�5�Z6gd�Z7dZ8dZ9e9j:dj:ej;�ed�Z<dd�Z=dd�Z>dd�Z?dBdd�Z@dCdd�ZAdDdd�ZBdedfd d!�ZCd"d#�ZDe�.d$ej0�ZEeDd%d&��ZFGd'd(�d(�ZGGd)d*�d*eG�ZHGd+d,�d,e�ZIe�.d-�jJZKd.d/�ZLd0d1�ZMdEd2d3�ZNd4d5�ZOGd6d7�d7�ZPGd8d9�d9e
jQ�ZRejSjTfd:d;�ZUd<d=�ZVeNe8�eU�ZUd>d?�ZWd@dA�ZXdS)Fz$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{}.{})Zpy_major�
setuptoolsc
CsFzt�|�WSty@}ztd|f�|�WYd}~n
d}~00dS)Nz1Not a URL, existing file, or requirement spec: %r)r�parse�
ValueErrorr)�spec�e�r#�</usr/lib/python3.9/site-packages/setuptools/package_index.py�parse_requirement_argDs��r%cCs�|��}d\}}}|�d�r�|�d�r8|dd�}d}nn|�dd�rb|d	d
�}|dd�}d}nD|�d�r~|dd�}d
}n(|�dd�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_verZplatr#r#r$rMs$



rc	Csxtj�|�}|\}}}}}}tj�|�d�d�}|dkrX|dkrXtj�|�d�d�}d|vrp|�dd�\}}||fS)N�/���zsourceforge.net�download����#�)�urllibr�urlparse�unquote�split)	�url�parts�scheme�server�path�
parameters�query�fragmentr-r#r#r$�egg_info_for_urlesrAccsPt|�\}}t|||�EdH|rLt�|�}|rLt||�d�|td�EdHdS)zEYield egg or source distribution objects that might be found at a URLNr4)�
precedence)rA�distros_for_location�EGG_FRAGMENT�matchr�groupr)r9�metadatar-r@rEr#r#r$rps
�rcCs�|�d�r|dd�}|�d�r8d|vr8t�|||�gS|�d�rxd|vrxt|�}|��s^gSt||j|jtdd�gS|�d	�r�t|�\}}}|dur�t	||||t
|�StD]0}|�|�r�|dt|��}t	|||�Sq�gS)
z:Yield egg or source distribution objects based on basename�.egg.zipNr(z.egg�-z.whlr4)�location�project_name�versionrBr&)
r*rZ
from_locationrZ
is_compatiblerKrLrrrr�
EXTENSIONS�len)rJ�basenamerGZwheelZwin_baser.�platform�extr#r#r$rC|s4
��	
�
rCcCstt|�tj�|�|�S)zEYield possible egg or source distribution objects based on a filename)rCr�osr=rO)�filenamerGr#r#r$�distros_for_filename�s�rTc	cs�|�d�}|s,tdd�|dd�D��r,dStt|��D]}||dd���r8q^q8t|�}t||d�|d|��d�||d��|||d�VdS)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!
    rIcss|]}t�d|�VqdS)z	py\d\.\d$N)�rerE)�.0�pr#r#r$�	<genexpr>��z(interpret_distro_name.<locals>.<genexpr>�Nr4)�
py_versionrBrP)r8�any�rangerN�isdigitr�join)rJrOrGr[rBrPr:rWr#r#r$r�s 

�rcst���fdd��}|S)zs
    Wrap a function returning an iterable such that the resulting iterable
    only ever yields unique items.
    cst�|i|���S�Nr)�args�kwargs��funcr#r$�wrapper�szunique_values.<locals>.wrapperr)rdrer#rcr$�
unique_values�srfz3<([^>]*\srel\s{0,10}=\s{0,10}['"]?([^'" >]+)[^>]*)>c	cs�t�|�D]d}|��\}}tttj|���d���}d|vsDd|vr
t	�|�D]}t
j�|t
|�d���VqNq
dD]@}|�|�}|dkrtt	�||�}|rtt
j�|t
|�d���VqtdS)zEFind rel="homepage" and rel="download" links in `page`, yielding URLs�,Zhomepager1r4)z
<th>Home Pagez<th>Download URLr0N)�REL�finditer�groups�set�map�str�stripr)r8�HREFr5r�urljoin�
htmldecoderF�find�search)r9�pagerE�tag�relZrels�posr#r#r$�find_external_links�s
rxc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�ContentCheckerzP
    A null content checker that defines the interface for checking content
    cCsdS)z3
        Feed a block of data to the hash.
        Nr#��self�blockr#r#r$�feed�szContentChecker.feedcCsdS)zC
        Check the hash. Return False if validation fails.
        Tr#�r{r#r#r$�is_valid�szContentChecker.is_validcCsdS)zu
        Call reporter with information about the checker (hash name)
        substituted into the template.
        Nr#)r{�reporter�templater#r#r$�report�szContentChecker.reportN)�__name__�
__module__�__qualname__�__doc__r}rr�r#r#r#r$ry�sryc@sBeZdZe�d�Zdd�Zedd��Zdd�Z	dd	�Z
d
d�ZdS)
�HashCheckerzK(?P<hash_name>sha1|sha224|sha384|sha256|sha512|md5)=(?P<expected>[a-f0-9]+)cCs||_t�|�|_||_dSr`)�	hash_name�hashlib�new�hash�expected)r{r�r�r#r#r$�__init__
szHashChecker.__init__cCsBtj�|�d}|st�S|j�|�}|s0t�S|fi|����S)z5Construct a (possibly null) ContentChecker from a URLr0)r5rr6ry�patternrs�	groupdict)�clsr9r@rEr#r#r$�from_urlszHashChecker.from_urlcCs|j�|�dSr`)r��updaterzr#r#r$r}szHashChecker.feedcCs|j��|jkSr`)r�Z	hexdigestr�r~r#r#r$r szHashChecker.is_validcCs||j}||�Sr`)r�)r{r�r��msgr#r#r$r�#s
zHashChecker.reportN)r�r�r�rU�compiler�r��classmethodr�r}rr�r#r#r#r$r�s�

r�csTeZdZdZdN�fdd�	Z�fdd	�ZdOdd�ZdPd
d�ZdQdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dRdd�Zdd�ZdS�fdd �	Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�ZdTd+d,�ZdUd-d.�Zd/d0�Zd1Zd2d3�Zd4d5�ZdVd6d7�Zd8d9�Zd:d;�Zd<d=�Zd>d?�Z d@dA�Z!e"dWdBdC��Z#dDdE�Z$dFdG�Z%dHdI�Z&dJdK�Z'dLdM�Z(�Z)S)Xrz;A distribution index that scans web pages for download URLs�https://pypi.org/simple/��*NTcslt�j|i|��|dd|�d��|_i|_i|_i|_t�d�	t
t|���j|_
g|_tjj|_dS)Nr/�|)�superr�r*�	index_url�scanned_urls�fetched_urls�
package_pagesrUr�r_rlrrE�allows�to_scanr5�request�urlopen�opener)r{r�ZhostsZ	ca_bundleZ
verify_sslra�kw��	__class__r#r$r�+s	zPackageIndex.__init__cs0zt|j�Wnty"YdS0t��|�Sr`)rrL�	Exceptionr��add)r{�distr�r#r$r�=s
zPackageIndex.addFcCs�||jvr|sdSd|j|<t|�s2|�|�dStt|��}|r\|�|�sPdS|�d|�|sn|rn||jvr�tt|j	|��dS|�|�s�d|j|<dS|�
d|�d|j|<d}|�|||�}|dur�dSt|t
jj�r�|jdkr�|�
d|j�d|j|j<d|j�d	d
���v�r(|��dS|j}|��}t|t��svt|t
jj��rXd}n|j�d��phd}|�|d
�}|��t�|�D](}	t
j�|t|	� d���}
|�!|
��q�|�"|j#��r�t$|dd�dk�r�|�%||�}dS)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�ignorer4�code�)&r��
URL_SCHEME�process_filename�listr�url_ok�debugr�rlr��info�open_url�
isinstancer5�error�	HTTPErrorr�r�r9�headers�getr)�close�readrmZ	get_param�decoderorirrprqrF�process_urlr+r��getattr�
process_index)r{r9Zretrieve�dists�tmpl�fr-rtr�rE�linkr#r#r$r�FsT





 zPackageIndex.process_urlcCs�tj�|�s|�d|�dStj�|�r^|s^tj�|�}t�|�D]}|�tj�||�d�qBt	|�}|r�|�
d|�tt|j
|��dS)Nz
Not found: %sTz	Found: %s)rRr=�exists�warn�isdir�realpath�listdirr�r_rTr�r�rlr�)r{�fn�nestedr=�itemr�r#r#r$r�{szPackageIndex.process_filenamecCsft|�}|o|�d���dk}|s8|�tj�|�d�r<dSd}|rRt||��n|�||�dSdS)Nr4�fileTz�
Note: Bypassing %s (disallowed host; see https://setuptools.pypa.io/en/latest/deprecated/easy_install.html#restricting-downloads-with-allow-hosts for details).
F)	r�rFr)r�r5rr6rr�)r{r9Zfatal�s�is_filer�r#r#r$r��s�zPackageIndex.url_okcCs2ttjj|�}dd�|D�}tt�|j|��dS)Ncss0|](}t�|�D]}|�d�r||fVqqdS)z	.egg-linkN)rRr�r*)rVr=�entryr#r#r$rX�s
�z.PackageIndex.scan_egg_links.<locals>.<genexpr>)�filterrRr=r�r��	itertools�starmap�
scan_egg_link)r{Zsearch_path�dirsZ	egg_linksr#r#r$�scan_egg_links�s
�zPackageIndex.scan_egg_linkscCs�ttj�||���&}ttdttj|���}Wd�n1s>0Yt	|�dkrXdS|\}}t
tj�||��D]*}tjj|g|�R�|_t|_
|�|�qrdS)NrZ)�openrRr=r_r�r�rlrmrnrNr
rJrrBr�)r{r=r�Z	raw_lines�linesZegg_pathZ
setup_pathr�r#r#r$r��s4zPackageIndex.scan_egg_linkcCs�d}|�|j�s|Stttjj|t|j�d��d���}t|�dksRd|dvrV|St	|d�}t
|d�}d|j�|�
�i�|<t|�t|�fS)N)NNr/rZr3r4rT)r+r�r�rlr5rr7rNr8rrr��
setdefaultr)r
)r{r�ZNO_MATCH_SENTINELr:�pkg�verr#r#r$�_scan�s&zPackageIndex._scanc	
Cs�t�|�D]:}z"|�tj�|t|�d����Wq
tyBYq
0q
|�|�\}}|s\dSt	||�D]H}t
|�\}}|�d�r�|s�|r�|d||f7}n
|�|�|�
|�qft�dd�|�S)z#Process the contents of a PyPI pager4r��.pyz
#egg=%s-%scSsd|�ddd�S)Nz<a href="%s#md5=%s">%s</a>r4�rZ)rF)�mr#r#r$�<lambda>�rYz,PackageIndex.process_index.<locals>.<lambda>)rorir�r5rrprqrFr rxrAr*�need_version_info�scan_url�PYPI_MD5�sub)	r{r9rtrEr�r��new_urlr-�fragr#r#r$r��s$"
�zPackageIndex.process_indexcCs|�d|�dS)NzPPage at %s links to .py file(s) without version info; an index scan is required.)�scan_all�r{r9r#r#r$r��s�zPackageIndex.need_version_infocGs<|j|jvr,|r"|j|g|�R�|�d�|�|j�dS)Nz6Scanning index of all packages (this may take a while))r�r�r�r�r��r{r�rar#r#r$r��s

zPackageIndex.scan_allcCsz|�|j|jd�|j�|j�s:|�|j|jd�|j�|j�sR|�|�t|j�|jd��D]}|�|�qfdS)Nr/r#)	r�r��unsafe_namer�r��keyrK�not_found_in_indexr�)r{�requirementr9r#r#r$�
find_packages�s
zPackageIndex.find_packagescsN|��|�|�||jD]"}||vr0|S|�d||�qt��||�S)Nz%s does not match %s)�prescanr�r�r�r��obtain)r{r�Z	installerr�r�r#r$r��s
zPackageIndex.obtaincCsL|�|jd|�|��sH|��t�|�td|jjtj	�
|�f��dS)z-
        checker is a ContentChecker
        zValidating %%s checksum for %sz7%s validation failed for %s; possible download problem?N)r�r�rr�rR�unlinkrr�r,r=rO)r{�checkerrS�tfpr#r#r$�
check_hashs
��zPackageIndex.check_hashcCsN|D]D}|jdus0t|�r0|�d�s0tt|��r<|�|�q|j�|�qdS)z;Add `urls` to the list that will be prescanned for searchesN�file:)r�r�r+r�rr��append)r{Zurlsr9r#r#r$�add_find_linkss���
�zPackageIndex.add_find_linkscCs"|jrtt|j|j��d|_dS)z7Scan urls scheduled for prescanning (e.g. --find-links)N)r�r�rlr�r~r#r#r$r�%szPackageIndex.prescancCs<||jr|jd}}n|jd}}|||j�|��dS)Nz#Couldn't retrieve index page for %rz3Couldn't find index page for %r (maybe misspelled?))r�r�r�r�r�)r{r�Zmethr�r#r#r$r�+s
�zPackageIndex.not_found_in_indexcCs~t|t�sjt|�}|rR|�|�d�||�}t|�\}}|�d�rN|�|||�}|Stj	�
|�rb|St|�}t|�
||�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.
        r4r�rJN)r�rr��
_download_urlrFrAr*�	gen_setuprRr=r�r%r��fetch_distribution)r{r!�tmpdirr;�foundr-r@r#r#r$r16s

zPackageIndex.downloadc	s���d|�i�d}d
�����fdd�	}|rH�����|�||�}|s^|dur^|||�}|dur��jdurx���||�}|dur�|s���|�||�}|dur���d�r�dp�d|�dS��d|�|j|jd	�SdS)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 %sNcs�|dur�}||jD]v}|jtkrF�sF|�vr��d|�d�|<q||vo\|jtkp\�}|r��|j��}||_tj	�
|j�r|SqdS)Nz&Skipping development or system egg: %sr4)r�rBrr�rr1rJ�download_locationrRr=r�)Zreq�envr��test�loc��
develop_okr{Zskipped�sourcer�r#r$rrvs$�
z-PackageIndex.fetch_distribution.<locals>.findz:No local packages or working download links found for %s%sza source distribution of r�zBest match: %s)rJ)N)r�r�r�r�r�Zcloner�)	r{r�r��
force_scanrrZlocal_indexr�rrr#rr$r�Xs4




�zPackageIndex.fetch_distributioncCs"|�||||�}|dur|jSdS)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)r�rJ)r{r�r�rrr�r#r#r$�fetch�szPackageIndex.fetchc		Cst�|�}|r*dd�t||�d�d�D�p,g}t|�dkr�tj�|�}tj�|�|kr�tj�	||�}tj�
|�r~tj�||�s�t�
||�|}ttj�	|d�d��<}|�d|dj|djtj�|�df�Wd�n1s�0Y|S|�r
td||f��ntd	��dS)
NcSsg|]}|jr|�qSr#)rL)rV�dr#r#r$�
<listcomp>�s�z*PackageIndex.gen_setup.<locals>.<listcomp>r4zsetup.py�wzIfrom setuptools import setup
setup(name=%r, version=%r, py_modules=[%r])
rz�Can't unambiguously interpret project/version identifier %r; any dashes in the name or version should be escaped using underscores. %rzpCan't process plain .py files without an '#egg=name-version' suffix to enable automatic setup script generation.)rDrErrFrNrRr=rO�dirnamer_r��samefile�shutil�copy2r��writerKrL�splitextr)	r{rSr@r�rEr�rO�dstr�r#r#r$r��sD
���
���"	���zPackageIndex.gen_setupi cCs:|�d|�d}�zt�|�}|�|�}t|tjj�rLtd||j	|j
f��|��}d}|j}d}d|vr�|�d�}	t
tt|	��}|�|||||�t|d��`}
|�|�}|r�|�|�|
�|�|d7}|�|||||�q�q�q�|�|||
�Wd�n1�s0Y|W|�r"|��Sn|�r4|��0dS)	NzDownloading %szCan't download %s: %s %srr0zcontent-lengthzContent-Length�wbr4)r�r�r�r�r�r5r�r�rr�r��dl_blocksizeZget_all�maxrl�int�
reporthookr�r�r}rr�r�)r{r9rS�fpr�r��blocknum�bs�sizeZsizesr�r|r#r#r$�_download_to�sD

�



.��zPackageIndex._download_tocCsdSr`r#)r{r9rSrZblksizerr#r#r$rszPackageIndex.reporthookc
Cs�|�d�rt|�Szt||j�WSttjjfy�}zHd�dd�|j	D��}|r`|�
||�ntd||f�|�WYd}~�n(d}~0tj
jy�}z|WYd}~Sd}~0tj
j�y}z4|r�|�
||j�ntd||jf�|�WYd}~n�d}~0tjj�yT}z6|�r,|�
||j�ntd||jf�|�WYd}~n\d}~0tjjtf�y�}z2|�r�|�
||�ntd||f�|�WYd}~n
d}~00dS)Nr�� cSsg|]}t|��qSr#)rm)rV�argr#r#r$r	rYz)PackageIndex.open_url.<locals>.<listcomp>z%s %szDownload error for %s: %sz;%s returned a bad status line. The server might be down, %s)r+�
local_open�open_with_authr�r �http�client�
InvalidURLr_rar�rr5r�r�ZURLError�reasonZ
BadStatusLine�lineZ
HTTPException�OSError)r{r9Zwarning�vr�r#r#r$r�sB
(�����zPackageIndex.open_urlcCs�t|�\}}|r0d|vr4|�dd��dd�}qnd}|�d�rJ|dd�}tj�||�}|dksj|�d	�rv|�||�S|d
ks�|�d�r�|�||�S|�d�r�|�	||�S|d
kr�t
j�t
j
�|�d�S|�|d�|�||�SdS)Nz..�.�\�_Z__downloaded__rHr(�svnzsvn+�gitzgit+zhg+r�rZT)rA�replacer*rRr=r_r+�
_download_svn�
_download_git�_download_hgr5r��url2pathnamerr6r��_attempt_download)r{r;r9r�r,r@rSr#r#r$r�1s$

zPackageIndex._download_urlcCs|�|d�dS)NT)r�r�r#r#r$r�NszPackageIndex.scan_urlcCs6|�||�}d|�dd���vr.|�|||�S|SdS)Nr�r�r�)rr�r)�_invalid_download_html)r{r9rSr�r#r#r$r1QszPackageIndex._attempt_downloadcCst�|�td|����dS)NzUnexpected HTML page found at )rRr�r)r{r9r�rSr#r#r$r2Xs
z#PackageIndex._invalid_download_htmlcCstd|����dS)Nz/Invalid config, SVN download is not supported: r)r{r9Z	_filenamer#r#r$r-\szPackageIndex._download_svncCsptj�|�\}}}}}|�dd�d}|�dd�d}d}d|vrR|�dd�\}}tj�||||df�}||fS)N�+r4r0r3r�@r�)r5r�urlsplitr8�rsplit�
urlunsplit)r9�
pop_prefixr;�netlocr=r?r��revr#r#r$�_vcs_split_rev_from_url_sz$PackageIndex._vcs_split_rev_from_urlcCsl|�dd�d}|j|dd�\}}|�d||�t�d||f�|durh|�d|�t�d	||f�|S)
Nr3r4rT�r8zDoing git clone from %s to %szgit clone --quiet %s %szChecking out %szgit -C %s checkout --quiet %s�r8r;r�rR�system�r{r9rSr:r#r#r$r.qs���zPackageIndex._download_gitcCsl|�dd�d}|j|dd�\}}|�d||�t�d||f�|durh|�d|�t�d	||f�|S)
Nr3r4rTr<zDoing hg clone from %s to %szhg clone --quiet %s %szUpdating to %szhg --cwd %s up -C -r %s -qr=r?r#r#r$r/�s���zPackageIndex._download_hgcGstj|g|�R�dSr`)rr�r�r#r#r$r��szPackageIndex.debugcGstj|g|�R�dSr`)rr�r�r#r#r$r��szPackageIndex.infocGstj|g|�R�dSr`)rr�r�r#r#r$r��szPackageIndex.warn)r�r�NT)F)F)F)N)N)FFFN)FF)N)F)*r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r1r�rr�rrrr�r�r�r1r2r-�staticmethodr;r.r/r�r�r��
__classcell__r#r#r�r$r(s\�	
5



	&�
R

.$
"rz!&(#(\d+|x[\da-fA-F]+)|[\w.:-]+);?cCs|�d�}t�|�S)Nr)rFr�Zunescape)rEZwhatr#r#r$�
decode_entity�s
rBcCs
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_subrB)�textr#r#r$rq�s	rqcs�fdd�}|S)Ncs��fdd�}|S)Nc	s>t��}t���z�|i|��Wt�|�St�|�0dSr`)�socketZgetdefaulttimeoutZsetdefaulttimeout)rarbZold_timeout)rd�timeoutr#r$�_socket_timeout�s

�z@socket_timeout.<locals>._socket_timeout.<locals>._socket_timeoutr#)rdrG�rFrcr$rG�sz'socket_timeout.<locals>._socket_timeoutr#)rFrGr#rHr$�socket_timeout�srIcCs2tj�|�}|��}t�|�}|��}|�dd�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�)r5rr7�encode�base64Z	b64encoder�r,)�authZauth_sZ
auth_bytesZ
encoded_bytesZencodedr#r#r$�_encode_auth�s

rNc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�
Credentialz:
    A username/password pair. Use like a namedtuple.
    cCs||_||_dSr`��username�password)r{rQrRr#r#r$r��szCredential.__init__ccs|jV|jVdSr`rPr~r#r#r$�__iter__�szCredential.__iter__cCsdt|�S)Nz%(username)s:%(password)s)�varsr~r#r#r$�__str__�szCredential.__str__N)r�r�r�r�r�rSrUr#r#r#r$rO�srOcs8eZdZ�fdd�Zedd��Zdd�Zdd�Z�ZS)	�
PyPIConfigcsLt�gd�d�}t��|�tj�tj�d�d�}tj�|�rH|�	|�dS)z%
        Load from ~/.pypirc
        )rQrR�
repositoryr��~z.pypircN)
�dict�fromkeysr�r�rRr=r_�
expanduserr�r�)r{�defaults�rcr�r#r$r��s
zPyPIConfig.__init__cs&�fdd����D�}tt�j|��S)Ncs g|]}��|d���r|�qS)rW)r�rn)rV�sectionr~r#r$r	�s�z2PyPIConfig.creds_by_repository.<locals>.<listcomp>)ZsectionsrYrl�_get_repo_cred)r{Zsections_with_repositoriesr#r~r$�creds_by_repository�s
�zPyPIConfig.creds_by_repositorycCs6|�|d���}|t|�|d���|�|d����fS)NrWrQrR)r�rnrO)r{r^Zrepor#r#r$r_s
�zPyPIConfig._get_repo_credcCs*|j��D]\}}|�|�r
|Sq
dS)z�
        If the URL indicated appears to be a repository defined in this
        config, return the credential for that repository.
        N)r`�itemsr+)r{r9rW�credr#r#r$�find_credential	s

zPyPIConfig.find_credential)	r�r�r�r��propertyr`r_rcrAr#r#r�r$rV�s

	rVcCs@tj�|�}|\}}}}}}|�d�r2tj�d��|dvrHt|�\}	}
nd}	|	s�t��	|�}|r�t
|�}	|j|f}tj
dg|�R�|	r�dt|	�}	||
||||f}
tj�|
�}tj�|�}|�d|	�ntj�|�}|�dt�||�}|	�r<tj�|j�\}}}}}}||k�r<||
k�r<||||||f}
tj�|
�|_|S)	z4Open a urllib2 request, handling HTTP authentication�:znonnumeric port: '')r �httpsNz*Authenticating as %s for %s (from .pypirc)zBasic Z
Authorizationz
User-Agent)r5rr6r*r r!r"�
_splituserrVrcrmrQrr�rN�
urlunparser�ZRequestZ
add_header�
user_agentr9)r9r��parsedr;r9r=�paramsr?r�rMZaddressrbr�r:r�r�r�s2Zh2Zpath2Zparam2Zquery2Zfrag2r#r#r$rs8

rcCs |�d�\}}}|r|nd|fS)zNsplituser('user[:passwd]@host[:port]')
    --> 'user[:passwd]', 'host[:port]'.r4N)�
rpartition)�host�user�delimr#r#r$rgCsrgcCs|Sr`r#)r9r#r#r$�
fix_sf_urlNsrqc	Cs,tj�|�\}}}}}}tj�|�}tj�|�r<tj�|�S|�	d�r�tj�
|�r�g}t�|�D]x}	tj�||	�}
|	dkr�t
|
d��}|��}Wd�n1s�0Yq�ntj�
|
�r�|	d7}	|�dj|	d��q`d}
|
j|d�|�d	�}d
\}}n
d\}}}dd
i}t�|�}tj�|||||�S)z7Read a local path, with special support for directoriesr/z
index.html�rNz<a href="{name}">{name}</a>)r,zB<html><head><title>{url}</title></head><body>{files}</body></html>rJ)r9�files)��ZOK)r�zPath not foundz	Not foundr�z	text/html)r5rr6r�r0rRr=�isfiler�r*r�r�r_r�r�r��format�io�StringIOr�r�)r9r;r<r=Zparamr?r�rSrsr��filepathr�bodyr��status�messager�Zbody_streamr#r#r$rRs.&�


r)N)N)N)r)Yr��sysrRrUrwr
rErLr�r�Zconfigparserr�Zhttp.clientr �urllib.parser5Zurllib.requestZurllib.error�	functoolsrrZ
pkg_resourcesrrrrrr	r
rrr
rrrr�	distutilsrZdistutils.errorsr�fnmatchrZsetuptools.wheelrZ setuptools.extern.more_itertoolsrr�rD�Iror�rEr�r8rM�__all__Z_SOCKET_TIMEOUTZ_tmplrv�version_inforir%rrArrCrTrrfrhrxryr�rr�rCrBrqrIrNrOZRawConfigParserrVr�r�rrgrqrr#r#r#r$�<module>s�@
��	

#
�
"

!
(/

Youez - 2016 - github.com/yon3zu
LinuXploit