Viewing File: /opt/alt/python38/lib/python3.8/site-packages/setuptools/__pycache__/package_index.cpython-38.pyc

U

+’aΛã@sdZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
ZddlZddlZddlZddlmZddlZddlmZmZmZmZmZmZmZmZmZm 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¡Z6ddddgZ7dZ8dZ9e9j:dj:ej;ŽedZ<dd„Z=dd„Z>dd„Z?dAdd„Z@dBdd„ZAdCdd „ZBdedfd!d„ZCd"d#„ZDe .d$ej0¡ZEeDd%d&„ƒZFGd'd(„d(ƒZGGd)d*„d*eGƒZHGd+d„deƒZIe .d,¡jJZKd-d.„ZLd/d0„ZMdDd1d2„ZNd3d4„ZOGd5d6„d6ƒZPGd7d8„d8ejQƒZRejSjTfd9d:„ZUd;d<„ZVeNe8ƒeUƒZUd=d>„ZWd?d@„ZXdS)Ez#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)Ú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
CsDzt |¡WStk
r>}ztd|fƒ|‚W5d}~XYnXdS)Nz1Not a URL, existing file, or requirement spec: %r)rÚparseÚ
ValueErrorr)ÚspecÚe©r!ú@/tmp/pip-install-1bd_1mtk/setuptools/setuptools/package_index.pyÚparse_requirement_arg6sÿþ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_verÚplatr!r!r"r?s$



c	Csxtj |¡}|\}}}}}}tj | d¡d¡}|dkrX|dkrXtj | d¡d¡}d|krp| dd¡\}}||fS)Nú/éÿÿÿÿzsourceforge.netÚdownloadéþÿÿÿú#é)ÚurllibrÚurlparseÚunquoteÚsplit)	ÚurlÚpartsÚschemeÚserverÚpathÚ
parametersÚqueryÚfragmentr+r!r!r"Úegg_info_for_urlWsr@ccs\t|ƒ\}}t|||ƒD]
}|Vq|rXt |¡}|rXt|| d¡|tdD]
}|VqLdS)zEYield egg or source distribution objects that might be found at a URLr3)Ú
precedenceN)r@Údistros_for_locationÚEGG_FRAGMENTÚmatchrÚgroupr)r8Úmetadatar+r?ÚdistrDr!r!r"rbs
ÿ
cCsä| d¡r|dd…}| d¡r8d|kr8t |||¡gS| d¡rxd|krxt|ƒ}| ¡s^gSt||j|jtddgS| d	¡rªt|ƒ\}}}|dk	rªt	||||t
|ƒStD]0}| |¡r®|dt|ƒ…}t	|||ƒSq®gS)
z:Yield egg or source distribution objects based on basenameú.egg.zipNr&z.eggú-z.whlr3)ÚlocationÚproject_nameÚversionrAr$)
r(rÚ
from_locationrÚ
is_compatiblerKrLrrrrÚ
EXTENSIONSÚlen)rJÚbasenamerFÚwheelZwin_baser,ÚplatformÚextr!r!r"rBps<
û
ÿ
rBcCstt|ƒtj |¡|ƒS)zEYield possible egg or source distribution objects based on a filename)rBrÚosr<rQ)ÚfilenamerFr!r!r"Údistros_for_filename‘s

ÿrWc
cs|| d¡}|s,tdd„|dd…Dƒƒr,dStdt|ƒdƒD]8}t||d |d|…¡d ||d…¡|||dVq>dS)zØGenerate alternative interpretations 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)ÚrerD)Ú.0Úpr!r!r"Ú	<genexpr>¯sz(interpret_distro_name.<locals>.<genexpr>éNr3)Ú
py_versionrArS)r7ÚanyÚrangerPrÚjoin)rJrQrFr]rArSr9rZr!r!r"r˜s
ýcstˆƒ‡fdd„ƒ}|S)zs
    Wrap a function returning an iterable such that the resulting iterable
    only ever yields unique items.
    cstˆ||ŽƒS©Nr)ÚargsÚkwargs©Úfuncr!r"ÚwrapperÁszunique_values.<locals>.wrapperr)rerfr!rdr"Ú
unique_values»srgz(<([^>]*\srel\s*=\s*['"]?([^'">]+)[^>]*)>c	csºt |¡D]d}| ¡\}}tttj| ¡ d¡ƒƒ}d|ksDd|kr
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ú,Zhomepager0r3)z
<th>Home Pagez<th>Download URLr/N)ÚRELÚfinditerÚgroupsÚsetÚmapÚstrÚstripr'r7ÚHREFr4rÚurljoinÚ
htmldecoderEÚfindÚsearch)r8ÚpagerDÚtagÚrelZrelsÚposr!r!r"Úfind_external_linksÌs
ryc@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~r€rƒr!r!r!r"rzßsrzc@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 |¡|_||_dSra)Ú	hash_nameÚhashlibÚnewÚhashÚexpected)r|r‰rr!r!r"Ú__init__þszHashChecker.__init__cCs>tj |¡d}|stƒS|j |¡}|s0tƒS|f| ¡ŽS)z5Construct a (possibly null) ContentChecker from a URLr/)r4rr5rzÚpatternrtÚ	groupdict)Úclsr8r?rDr!r!r"Úfrom_urlszHashChecker.from_urlcCs|j |¡dSra)rŒÚupdater{r!r!r"r~szHashChecker.feedcCs|j ¡|jkSra)rŒÚ	hexdigestrrr!r!r"r€szHashChecker.is_validcCs||j}||ƒSra)r‰)r|rr‚Úmsgr!r!r"rƒs
zHashChecker.reportN)r„r…r†rXÚcompilerrŽÚclassmethodr’r~r€rƒr!r!r!r"rˆøsÿ

rˆcsDeZdZdZdLdd„ZdMd	d
„ZdNdd„ZdOd
d„Zdd„Zdd„Z	dd„Z
dd„Zdd„ZdPdd„Z
dd„ZdQ‡fdd„	Zdd „Zd!d"„Zd#d$„Zd%d&„Zd'd(„ZdRd)d*„ZdSd+d,„Zd-d.„Zd/Zd0d1„Zd2d3„ZdTd4d5„Zd6d7„Zd8d9„Zd:d;„Zd<d=„Zd>d?„Z e!dUd@dA„ƒZ"dBdC„Z#dDdE„Z$dFdG„Z%dHdI„Z&dJdK„Z'‡Z(S)Vrz;A distribution index that scans web pages for download URLsúhttps://pypi.org/simple/©Ú*NTcOsltj|f|ž|Ž|dd| d¡…|_i|_i|_i|_t d 	t
t|ƒ¡¡j|_
g|_tjj|_dS)Nr.ú|)r	rŽr(Ú	index_urlÚscanned_urlsÚfetched_urlsÚ
package_pagesrXr–r`rmrrDÚallowsÚto_scanr4ÚrequestÚurlopenÚopener)r|rœÚhostsZ	ca_bundleZ
verify_sslrbÚkwr!r!r"rŽszPackageIndex.__init__FcCsâ||jkr|sdSd|j|<t|ƒs2| |¡dStt|ƒƒ}|r\| |¡sPdS| d|¡|sn|rn||jkr‚tt|j	|ƒƒdS| |¡sšd|j|<dS| 
d|¡d|j|<d}| |||¡}|dkrÐdSt|t
jjƒrø|jdkrø| 
d|j¡d|j|j<d|j d	d
¡ ¡kr(| ¡dS|j}| ¡}t|tƒsvt|t
jjƒrXd}n|j d¡phd}| |d
¡}| ¡t |¡D](}	t
j |t|	  d¡ƒ¡}
| !|
¡qˆ| "|j#¡rÞt$|ddƒdkrÞ| %||¡}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Úignorer3Úcodeé”)&rÚ
URL_SCHEMEÚprocess_filenameÚlistrÚurl_okÚdebugržrmÚaddÚinfoÚopen_urlÚ
isinstancer4ÚerrorÚ	HTTPErrorr¬r•r8ÚheadersÚgetr'ÚcloseÚreadrnÚ	get_paramÚdecoderprjrrqrrrEÚprocess_urlr)rœÚgetattrÚ
process_index)r|r8ÚretrieveÚdistsÚtmplÚfr+rurªrDÚlinkr!r!r"r¿*sT





 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)rUr<ÚexistsÚwarnÚisdirÚrealpathÚlistdirr¯r`rWr²r°rmr³)r|ÚfnÚnestedr<ÚitemrÃr!r!r"r¯_szPackageIndex.process_filenamecCsbt|ƒ}|o| d¡ ¡dk}|s8| tj |¡d¡r<dSd}|rRt||ƒ‚n| ||¡dS)Nr3ÚfileTzN
Note: Bypassing %s (disallowed host; see http://bit.ly/2hrImnY for details).
)	r®rEr'r r4rr5rrÈ)r|r8ÚfatalÚsÚis_filer•r!r!r"r±osÿzPackageIndex.url_okcCs2ttjj|ƒ}dd„|Dƒ}tt |j|¡ƒdS)Ncss0|](}t |¡D]}| d¡r||fVqqdS)z	.egg-linkN)rUrËr()rYr<Úentryr!r!r"r[~s

ýz.PackageIndex.scan_egg_links.<locals>.<genexpr>)ÚfilterrUr<rÉr°Ú	itertoolsÚstarmapÚ
scan_egg_link)r|Úsearch_pathÚdirsZ	egg_linksr!r!r"Úscan_egg_links|s
þzPackageIndex.scan_egg_linksc	CsŒttj ||¡ƒ}ttdttj|ƒƒƒ}W5QRXt	|ƒdkrDdS|\}}t
tj ||¡ƒD](}tjj|f|žŽ|_t|_
| |¡q^dS)Nr\)ÚopenrUr<r`r°rÔrmrnrorPr
rJrrAr³)r|r<rÓZ	raw_linesÚlinesZegg_pathZ
setup_pathrGr!r!r"r׆s zPackageIndex.scan_egg_linkcCs”d}| |j¡s|Stttjj|t|jƒd… d¡ƒƒ}t|ƒdksRd|dkrV|St	|dƒ}t
|dƒ}d|j | 
¡i¡|<t|ƒt|ƒfS)N)NNr.r\r2r3rT)r)rœr°rmr4rr6rPr7rrrŸÚ
setdefaultr'r
)r|rÆZNO_MATCH_SENTINELr9ÚpkgÚverr!r!r"Ú_scan–sÿzPackageIndex._scanc	
CsÂt |¡D]<}z"| tj |t| d¡ƒ¡¡Wq
tk
rDYq
Xq
| |¡\}}|s^dSt	||ƒD]H}t
|ƒ\}}| d¡r¦|s¦|rœ|d||f7}n
| |¡| 
|¡qht dd„|¡S)z#Process the contents of a PyPI pager3r©ú.pyz
#egg=%s-%scSsd| ddd¡S)Nz<a href="%s#md5=%s">%s</a>r3ér\)rE)Úmr!r!r"Ú<lambda>Âóz,PackageIndex.process_index.<locals>.<lambda>)rprjràr4rrqrrrErryr@r(Úneed_version_infoÚscan_urlÚPYPI_MD5Úsub)	r|r8rurDrÞ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|r8r!r!r"ræÅsþzPackageIndex.need_version_infocGs:|j|jkr*|r |j|f|žŽ| d¡| |j¡dS)Nz6Scanning index of all packages (this may take a while))rœržrÈr´rç©r|r•rbr!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|Úrequirementr8r!r!r"Ú
find_packagesÔs
zPackageIndex.find_packagescsR| ¡| |¡||jD]"}||kr0|S| d||¡qtt|ƒ ||¡S)Nz%s does not match %s)Úprescanrórðr²ÚsuperrÚobtain)r|ròÚ	installerrG©Ú	__class__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²r€r»rUÚunlinkrrŒr*r<rQ)r|ÚcheckerrVÚtfpr!r!r"Ú
check_hashìsþ
þÿzPackageIndex.check_hashcCsN|D]D}|jdks0t|ƒ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|Úurlsr8r!r!r"Úadd_find_linksüsÿþý
üzPackageIndex.add_find_linkscCs"|jrtt|j|jƒƒd|_dS)z7Scan urls scheduled for prescanning (e.g. --find-links)N)r¡r°rmrçrr!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òÚmethr•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.
        r3rárJN)r¶rr®Ú
_download_urlrEr@r(Ú	gen_setuprUr<rÇr#rÀÚfetch_distribution)r|rÚtmpdirr:Úfoundr+r?r!r!r"r0s

zPackageIndex.downloadc	s܈ d|¡i‰d}d
‡‡‡‡‡fdd„	}|rHˆ ¡ˆ |¡||ƒ}|s^|dk	r^|||ƒ}|dkr€ˆjdk	rxˆ ¡||ƒ}|dkrž|sžˆ |¡||ƒ}|dkr¾ˆ dˆr´dp¶d|¡nˆ 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’|dkrˆ}||jD]v}|jtkrFˆsF|ˆkrˆ d|¡dˆ|<q||ko\|jtkp\ˆ}|rˆ |jˆ¡}||_tj	 
|j¡r|SqdS)Nz&Skipping development or system egg: %sr3)rðrArrÈrr0rJÚdownload_locationrUr<rÇ)ÚreqÚenvrGÚtestÚloc©Ú
develop_okr|ÚskippedÚsourcerr!r"rsUs&ÿþ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ÈÚcloner)	r|ròrÚ
force_scanrrZlocal_indexrGrsr!r
r"r=s2




ýzPackageIndex.fetch_distributioncCs"| ||||¡}|dk	r|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)rrJ)r|ròrrrrGr!r!r"Úfetch‰szPackageIndex.fetchc
	Csüt |¡}|r*dd„t|| d¡dƒDƒp,g}t|ƒdkrÚtj |¡}tj |¡|krŠtj 	||¡}ddl
m}|||ƒsŠt 
||¡|}ttj 	|d¡dƒ2}	|	 d|dj|djtj |¡df¡W5QRX|S|rðtd	||fƒ‚ntd
ƒ‚dS)NcSsg|]}|jr|‘qSr!)rL)rYÚdr!r!r"Ú
<listcomp>˜sÿz*PackageIndex.gen_setup.<locals>.<listcomp>r3r)Úsamefilezsetup.pyÚwzIfrom setuptools import setup
setup(name=%r, version=%r, py_modules=[%r])
z†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.)rCrDrrErPrUr<rQÚdirnamer`Zsetuptools.command.easy_installrÚshutilÚcopy2rÛÚwriterKrLÚsplitextr)
r|rVr?rrDrÃrQÚdstrrÏr!r!r"r–sB

þý
þþÿþÿÿzPackageIndex.gen_setupi c	Cs| d|¡d}zît |¡}| |¡}t|tjjƒrJt	d||j
|jfƒ‚| ¡}d}|j}d}d|kr’| 
d¡}	ttt|	ƒƒ}| |||||¡t|dƒV}
| |¡}|rà| |¡|
 |¡|d7}| |||||¡qžqàqž| |||
¡W5QRX|W¢S|r| ¡XdS)	NzDownloading %szCan't download %s: %s %srr/zcontent-lengthzContent-LengthÚwbr3)r´r»rˆr’rµr¶r4r·r¸rr¬r•Údl_blocksizeÚget_allÚmaxrmÚintÚ
reporthookrÛr¼r~rrý)r|r8rVÚfprûr¹ÚblocknumÚbsÚsizeZsizesrür}r!r!r"Ú_download_toÁs:

ÿ



zPackageIndex._download_tocCsdSrar!)r|r8rVr%Zblksizer'r!r!r"r#åszPackageIndex.reporthookc
Cs¨| d¡rt|ƒSzt||jƒWSttjjfk
r†}z>d dd„|j	Dƒ¡}|rb| 
||¡ntd||fƒ|‚W5d}~XYntj
jk
r²}z|WY¢Sd}~XYnòtj
jk
r}z,|rÜ| 
||j¡ntd||jfƒ|‚W5d}~XYn¤tjjk
rP}z.|r,| 
||j¡ntd||jfƒ|‚W5d}~XYnTtjjtj
fk
r¢}z*|r€| 
||¡ntd||fƒ|‚W5d}~XYnXdS)Nrþú cSsg|]}t|ƒ‘qSr!)rn)rYÚargr!r!r"rïsz)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`rbrÈrr4r·r¸ÚURLErrorÚreasonÚ
BadStatusLineÚlineÚ
HTTPExceptionÚsocket)r|r8ÚwarningÚvr•r!r!r"rµésJ
$ÿÿþÿüÿÿzPackageIndex.open_urlcCsæt|ƒ\}}|r0d|kr4| 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Ïr\T)r@Úreplacer(rUr<r`r)Ú
_download_svnÚ
_download_gitÚ_download_hgr4r¢Úurl2pathnamerr5r±Ú_attempt_download)r|r:r8rr*r?rVr!r!r"rs$

zPackageIndex._download_urlcCs| |d¡dS)NT)r¿rír!r!r"rç)szPackageIndex.scan_urlcCs6| ||¡}d| dd¡ ¡kr.| |||¡S|SdS)Nr§r¨r©)r(rºr'Ú_download_html)r|r8rVr¹r!r!r"rB,szPackageIndex._attempt_downloadcCsnt|ƒ}|D]>}| ¡rt d|¡rF| ¡t |¡| ||¡SqLq| ¡t |¡td|ƒ‚dS)Nz <title>([^- ]+ - )?Revision \d+:zUnexpected HTML page found at )	rÛrorXrtr»rUrúr>r)r|r8r¹rVrÏr3r!r!r"rC3s

zPackageIndex._download_htmlcCst dt¡| dd¡d}d}| ¡ d¡râd|krâtj |¡\}}}}}}	|sâ| d¡râd	|d
d…krâ|d
d… d	d¡\}}t	|ƒ\}
}|
râd|
krº|
 dd¡\}}
d||
f}nd
|
}|}||||||	f}tj 
|¡}| d||¡t 
d|||f¡|S)Nz"SVN download support is deprecatedr2r3rr©zsvn:ú@z//r.r\ú:z --username=%s --password=%sz --username=z'Doing subversion checkout from %s to %szsvn checkout%s -q %s %s)ÚwarningsrÈÚUserWarningr7r'r)r4rr5Ú
_splituserÚ
urlunparser´rUÚsystem)r|r8rVÚcredsr:Únetlocr<rZÚqrÅÚauthÚhostÚuserÚpwr9r!r!r"r>Bs&zPackageIndex._download_svncCsptj |¡\}}}}}| dd¡d}| dd¡d}d}d|krR| dd¡\}}tj ||||df¡}||fS)Nú+r3r/r2rrDr©)r4rÚurlsplitr7ÚrsplitÚ
urlunsplit)r8Ú
pop_prefixr:rLr<r>rëÚrevr!r!r"Ú_vcs_split_rev_from_urlXsz$PackageIndex._vcs_split_rev_from_urlcCsl| dd¡d}|j|dd\}}| d||¡t d||f¡|dk	rh| d|¡t d	||f¡|S)
Nr2r3rT©rVzDoing git clone from %s to %szgit clone --quiet %s %szChecking out %szgit -C %s checkout --quiet %s©r7rXr´rUrJ©r|r8rVrWr!r!r"r?jsþzPackageIndex._download_gitcCsl| dd¡d}|j|dd\}}| d||¡t d||f¡|dk	rh| d|¡t d	||f¡|S)
Nr2r3rTrYzDoing hg clone from %s to %szhg clone --quiet %s %szUpdating to %szhg --cwd %s up -C -r %s -qrZr[r!r!r"r@zsþzPackageIndex._download_hgcGstj|f|žŽdSra)rr²rîr!r!r"r²ŠszPackageIndex.debugcGstj|f|žŽdSra)rr´rîr!r!r"r´szPackageIndex.infocGstj|f|žŽdSra)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ýrrôrñr0rrrrr(r#rµrrçrBrCr>ÚstaticmethodrXr?r@r²r´rÈÚ
__classcell__r!r!rør"rsZþ

5




		
#þ
L

)$
#z!&(#(\d+|x[\da-fA-F]+)|[\w.:-]+);?cCs| d¡}t |¡S)Nr)rEr§Úunescape)rDÚwhatr!r!r"Ú
decode_entity™s
r`cCs
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`)Útextr!r!r"rržs	rrcs‡fdd„}|S)Ncs‡‡fdd„}|S)Nc	s2t ¡}t ˆ¡zˆ||ŽW¢St |¡XdSra)r5ÚgetdefaulttimeoutÚsetdefaulttimeout)rbrcZold_timeout)reÚtimeoutr!r"Ú_socket_timeout¬s

z@socket_timeout.<locals>._socket_timeout.<locals>._socket_timeoutr!)rerf©rerdr"rf«sz'socket_timeout.<locals>._socket_timeoutr!)rerfr!rgr"Úsocket_timeoutªsrhcCs2tj |¡}| ¡}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©)r4rr6ÚencodeÚbase64Ú	b64encoder¾r=)rNZauth_sZ
auth_bytesZ
encoded_bytesÚencodedr!r!r"Ú_encode_auth¹s

rnc@s(eZdZdZdd„Zdd„Zdd„ZdS)	Ú
Credentialz:
    A username/password pair. Use like a namedtuple.
    cCs||_||_dSra©ÚusernameÚpassword)r|rqrrr!r!r"rŽÓszCredential.__init__ccs|jV|jVdSrarprr!r!r"Ú__iter__×szCredential.__iter__cCsdt|ƒS)Nz%(username)s:%(password)s)Úvarsrr!r!r"Ú__str__ÛszCredential.__str__N)r„r…r†r‡rŽrsrur!r!r!r"roÎsroc@s0eZdZdd„Zedd„ƒZdd„Zdd„Zd	S)
Ú
PyPIConfigcCsPt dddgd¡}tj ||¡tj tj d¡d¡}tj 	|¡rL| 
|¡dS)z%
        Load from ~/.pypirc
        rqrrÚ
repositoryr©ú~z.pypircN)ÚdictÚfromkeysÚconfigparserÚRawConfigParserrŽrUr<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ºro)rYÚsectionrr!r"rísÿz2PyPIConfig.creds_by_repository.<locals>.<listcomp>)ÚsectionsryrmÚ_get_repo_cred)r|Zsections_with_repositoriesr!rr"Úcreds_by_repositoryës
ÿzPyPIConfig.creds_by_repositorycCs6| |d¡ ¡}|t| |d¡ ¡| |d¡ ¡ƒfS)Nrwrqrr)rºroro)r|r€Úrepor!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|r8rwÚcredr!r!r"Úfind_credentialûs
zPyPIConfig.find_credentialN)r„r…r†rŽÚpropertyrƒr‚r‡r!r!r!r"rvßs

rvcCs<tj |¡}|\}}}}}}| d¡r2tj d¡‚|dkrHt|ƒ\}	}
nd}	|	s€tƒ 	|¡}|r€t
|ƒ}	|j|f}tj
d	|žŽ|	rÆdt|	ƒ}	||
||||f}
tj |
¡}tj |¡}| d|	¡ntj |¡}| dt¡||ƒ}|	r8tj |j¡\}}}}}}||kr8||
kr8||||||f}
tj |
¡|_|S)
z4Open a urllib2 request, handling HTTP authenticationrEznonnumeric port: '')r-ÚhttpsNú*Authenticating as %s for %s (from .pypirc)zBasic Ú
Authorizationz
User-Agent)rŠ)r4rr5r(r-r.r/rHrvr‡rnrqrr´rnrIr¢ÚRequestÚ
add_headerÚ
user_agentr8)r8r¤Úparsedr:rLr<Úparamsr>rërNÚaddressr†r´r9rêr¢r$Ús2Úh2Úpath2Zparam2Zquery2Zfrag2r!r!r"r,s8

r,cCs | d¡\}}}|r|nd|fS)zNsplituser('user[:passwd]@host[:port]')
    --> 'user[:passwd]', 'host[:port]'.rDN)Ú
rpartition)rOrPÚdelimr!r!r"rH4srHcCs|Srar!)r8r!r!r"Ú
fix_sf_url?sr—c
Cstj |¡\}}}}}}tj |¡}tj |¡r<tj |¡S| 	d¡rètj 
|¡règ}t |¡D]d}	tj ||	¡}
|	dkržt
|
dƒ}| ¡}W5QRXqÞntj 
|
¡r²|	d7}	| dj|	d¡q`d}
|
j|d |¡d}d	\}}n
d
\}}}ddi}t |¡}tj |||||¡S)
z7Read a local path, with special support for directoriesr.z
index.htmlÚrz<a href="{name}">{name}</a>)r*zB<html><head><title>{url}</title></head><body>{files}</body></html>ri)r8Úfiles)éÈÚOK)r­zPath not foundz	Not foundr¨z	text/html)r4rr5r¢rArUr<Úisfiler£r(rÉrËr`rÛr¼rÿÚformatÚioÚStringIOr·r¸)r8r:r;r<Úparamr>rërVr™rÅÚfilepathr$ÚbodyrÄÚstatusÚmessager¹Zbody_streamr!r!r"r+Cs.ÿ


r+)N)N)N)r)Yr‡ÚsysrUrXržrr5rkrŠrÕrFr{r§Úhttp.clientr-Úurllib.parser4Úurllib.requestÚurllib.errorÚ	functoolsrrÚ
pkg_resourcesrrrrrr	r
rrr
rrrÚ	distutilsrÚdistutils.errorsrÚfnmatchrZsetuptools.wheelrZ setuptools.extern.more_itertoolsrr–rCÚIrprèrDr®r7rOÚ__all__Z_SOCKET_TIMEOUTZ_tmplrÚversion_inforŽr#rr@rrBrWrrgriryrzrˆrrérar`rrrhrnror|rvr¢r£r,rHr—r+r!r!r!r"Ú<module>s˜<
ÿþ
ÿ	

!
þ
#

!
&/
Back to Directory File Manager