a §5€aΛã@sŒdZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl 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 .d ej0¡Z1e .d ¡Z2e .d ej0¡j3Z4d 5¡Z6gd¢Z7dZ8dZ9e9j:dj:ej;ŽedZdd„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;„ZUdd?„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)Úlog)ÚDistutilsError)Ú translate)ÚWheel©Úunique_everseenz^egg=([-A-Za-z0-9_.+!]+)$zhref\s*=\s*['"]?([^'"> ]+)zƒ([^<]+)\n\s+\(md5\)z([-+.a-z0-9]{2,}):z.tar.gz .tar.bz2 .tar .zip .tgz)Ú PackageIndexÚdistros_for_urlÚparse_bdist_wininstÚinterpret_distro_nameézccs\t|ƒ\}}t|||ƒD] }|Vq|rXt |¡}|rXt|| d¡|tdD] }|VqLdS)zEYield egg or source distribution objects that might be found at a URLr1)Ú precedenceN)r>Údistros_for_locationÚ EGG_FRAGMENTÚmatchrÚgroupr)r6Úmetadatar*r=ÚdistrBr!r!r"rbs  ÿ rcCsä| d¡r|dd…}| d¡r8d|vr8t |||¡gS| d¡rxd|vrxt|ƒ}| ¡s^gSt||j|jtddgS| d ¡rªt|ƒ\}}}|durªt ||||t |ƒSt D]0}| |¡r®|dt |ƒ …}t |||ƒSq®gS) z:Yield egg or source distribution objects based on basenameú.egg.zipNr%z.eggú-z.whlr1)ÚlocationÚ project_nameÚversionr?r$) r'rZ from_locationrZ is_compatiblerIrJrrrrÚ EXTENSIONSÚlen)rHÚbasenamerDZwheelZwin_baser+ÚplatformZextr!r!r"r@ps2  û  ÿ r@cCstt|ƒtj |¡|ƒS)zEYield possible egg or source distribution objects based on a filename)r@rÚosr:rM)ÚfilenamerDr!r!r"Údistros_for_filename‘sÿrQc 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! rGcss|]}t d|¡VqdS)z py\d\.\d$N)ÚrerB)Ú.0Úpr!r!r"Ú ¯óz(interpret_distro_name..éNr1)Ú py_versionr?rN)r5ÚanyÚrangerLrÚjoin)rHrMrDrXr?rNr7rTr!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..wrapperr)r`rar!r_r"Ú unique_values»srbz(<([^>]*\srel\s*=\s*['"]?([^'">]+)[^>]*)>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ú,Zhomepager.r1)z Home PagezDownload URLr-N)ÚRELÚfinditerÚgroupsÚsetÚmapÚstrÚstripr&r5ÚHREFr2rÚurljoinÚ htmldecoderCÚfindÚsearch)r6ÚpagerBÚtagÚrelZrelsÚposr!r!r"Úfind_external_linksÌs   rtc@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!©rwr!r!r"Úis_validêszContentChecker.is_validcCsdS)zu Call reporter with information about the checker (hash name) substituted into the template. Nr!)rwÚreporterÚtemplater!r!r"ÚreportðszContentChecker.reportN)Ú__name__Ú __module__Ú __qualname__Ú__doc__ryr{r~r!r!r!r"rußsruc@sBeZdZe d¡Zdd„Zedd„ƒZdd„Z dd „Z d d „Z d S) Ú HashCheckerzK(?Psha1|sha224|sha384|sha256|sha512|md5)=(?P[a-f0-9]+)cCs||_t |¡|_||_dSr\)Ú hash_nameÚhashlibÚnewÚhashÚexpected)rwr„rˆr!r!r"Ú__init__þs zHashChecker.__init__cCsBtj |¡d}|stƒS|j |¡}|s0tƒS|fi| ¡¤ŽS)z5Construct a (possibly null) ContentChecker from a URLr-)r2rr3ruÚpatternroÚ groupdict)Úclsr6r=rBr!r!r"Úfrom_urls zHashChecker.from_urlcCs|j |¡dSr\)r‡Úupdatervr!r!r"ryszHashChecker.feedcCs|j ¡|jkSr\)r‡Z hexdigestrˆrzr!r!r"r{szHashChecker.is_validcCs||j}||ƒSr\)r„)rwr|r}Úmsgr!r!r"r~s zHashChecker.reportN) rr€rrRÚcompilerŠr‰Ú classmethodrryr{r~r!r!r!r"rƒøsÿ rƒcsDeZdZdZdLdd„ZdMd d „ZdNd d „ZdOd d„Zdd„Zdd„Z dd„Z dd„Z dd„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;„Zdd?„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/©Ú*NTcOsrtj|g|¢Ri|¤Ž|dd| d¡ …|_i|_i|_i|_t d  t t |ƒ¡¡j |_ g|_tjj|_dS)Nr,ú|)r r‰r'Ú index_urlÚ scanned_urlsÚ fetched_urlsÚ package_pagesrRrr[rhrrBÚallowsÚto_scanr2ÚrequestÚurlopenÚopener)rwr–ZhostsZ ca_bundleZ verify_sslr]Úkwr!r!r"r‰szPackageIndex.__init__Fc Csâ||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 ¡ ¡vr(| ¡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.)ÚfilterrOr:rÀr©Ú itertoolsÚstarmapÚ scan_egg_link)rwZ search_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)NrW)ÚopenrOr:r[r©rÊrhrirjrLr rHrr?r¬)rwr:rÉZ raw_linesÚlinesZegg_pathZ setup_pathrEr!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,rWr0r1rT)r(r–r©rhr2rr4rLr5r r r™Ú setdefaultr&r )rwr½ZNO_MATCH_SENTINELr7Ú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 pager1r¢ú.pyz #egg=%s-%scSsd| ddd¡S)Nz%sr1érW)rC)Úmr!r!r"ÚÂrVz,PackageIndex.process_index..)rkrerÕr2rrlrmrCrrtr>r'Úneed_version_infoÚscan_urlÚPYPI_MD5Úsub) rwr6rprBrÓ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©rwr6r!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Û©rwrr]r!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³ÚkeyrIÚnot_found_in_indexr©)rwÚ requirementr6r!r!r"Ú find_packagesÔs zPackageIndex.find_packagescsR| ¡| |¡||jD]"}||vr0|S| d||¡qtt|ƒ ||¡S)Nz%s does not match %s)Úprescanrçrär«ÚsuperrÚobtain)rwræZ installerrE©Ú __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´rOÚunlinkrr‡r)r:rM)rwÚcheckerrPÚtfpr!r!r"Ú check_hashìsþ þÿ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)rwZurlsr6r!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©rhrÛrzr!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à)rwræZmethrr!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. r1rÖrHN)r¯rr§Ú _download_urlrCr>r'Ú gen_setuprOr:r¾r#r¸Úfetch_distribution)rwrÚtmpdirr8Úfoundr*r=r!r!r"r.s    zPackageIndex.downloadc s܈ d|¡i‰d}d ‡‡‡‡‡fdd„ }|rHˆ ¡ˆ |¡||ƒ}|s^|dur^|||ƒ}|dur€ˆjdurxˆ ¡||ƒ}|durž|sžˆ |¡||ƒ}|dur¾ˆ 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’|dur ˆ}||jD]v}|jtkrFˆsF|ˆvrˆ d|¡dˆ|<q||vo\|jtkp\ˆ }|rˆ |jˆ¡}||_tj   |j¡r|SqdS)Nz&Skipping development or system egg: %sr1) rär?rr¿rr.rHÚdownload_locationrOr:r¾)ZreqÚenvrEÚtestZloc©Ú develop_okrwZskippedÚsourcer÷r!r"rnUs$ÿþz-PackageIndex.fetch_distribution..findz:No local packages or working download links found for %s%sza source distribution of r¢zBest match: %s)rH)N)r­rèrçr›r¿Zclonerù) rwrær÷Ú force_scanrþrýZ local_indexrErnr!rür"rö=s2        ý 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örH)rwrær÷rÿrþrEr!r!r"Úfetch‰szPackageIndex.fetchc Cst |¡}|r*dd„t|| d¡dƒDƒp,g}t|ƒdkrîtj |¡}tj |¡|krŠtj  ||¡}ddl m }|||ƒsŠt   ||¡|}ttj  |d¡dƒ<} |  d|dj|djtj |¡df¡Wdƒn1sà0Y|S|rtd ||fƒ‚ntd ƒ‚dS) NcSsg|]}|jr|‘qSr!)rJ)rSÚdr!r!r"Ú ˜sÿz*PackageIndex.gen_setup..r1r)Ú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.)rArBrrCrLrOr:rMÚdirnamer[Zsetuptools.command.easy_installrÚshutilZcopy2rÐÚwriterIrJÚsplitextr) rwrPr=r÷rBrºrMZdstrrÆr!r!r"rõ–s@  þý     þþÿ"þÿÿ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ƒn1s0Y|W|r"| ¡Sn|r4| ¡0dS) NzDownloading %szCan't download %s: %s %srr-zcontent-lengthzContent-LengthÚwbr1)r­rƒrr®r¯r2r°r±rr¥rÚ dl_blocksizeZget_allÚmaxrhÚintÚ reporthookrÐrµryrrðr´) rwr6rPÚfprîr²ÚblocknumÚbsÚsizeZsizesrïrxr!r!r"Ú _download_toÁsD   ÿ     .ýÿzPackageIndex._download_tocCsdSr\r!)rwr6rPrZblksizerr!r!r"r åszPackageIndex.reporthookc Cs®| d¡rt|ƒSzt||jƒWSttjjfyˆ}zHd dd„|j Dƒ¡}|r`|  ||¡nt d||fƒ|‚WYd}~n*d}~0t j jy²}z|WYd}~Sd}~0t j jy}z4|rÚ|  ||j¡nt d||jfƒ|‚WYd}~n°d}~0tjjyT}z6|r,|  ||j¡nt d||jfƒ|‚WYd}~n^d}~0tjjtj fy¨}z2|r‚|  ||¡nt d||fƒ|‚WYd}~n d}~00dS)Nrñú cSsg|] }t|ƒ‘qSr!)ri)rSÚargr!r!r"rïrVz)PackageIndex.open_url..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[r]r¿rr2r°r±ZURLErrorÚreasonZ BadStatusLineÚlineZ HTTPExceptionÚsocket)rwr6ZwarningÚvrr!r!r"r®ésJ (ÿÿþÿüÿÿ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__rFr%Úsvnzsvn+Úgitzgit+zhg+rÆrWT)r>Úreplacer'rOr:r[r(Ú _download_svnÚ _download_gitÚ _download_hgr2rœÚ url2pathnamerr3rªÚ_attempt_download)rwr8r6r÷r)r=rPr!r!r"rô s$        zPackageIndex._download_urlcCs| |d¡dS)NT)r·rár!r!r"rÛ)szPackageIndex.scan_urlcCs6| ||¡}d| dd¡ ¡vr.| |||¡S|SdS)Nr r¡r¢)rr³r&Ú_download_html)rwr6rPr²r!r!r"r(,s zPackageIndex._attempt_downloadcCsnt|ƒ}|D]>}| ¡r t d|¡rF| ¡t |¡| ||¡SqLq | ¡t |¡td|ƒ‚dS)Nz ([^- ]+ - )?Revision \d+:zUnexpected HTML page found at ) rÐ���rj���rR���ro���r´���rO���rí���r$��r���)rw���r6���r²���rP���rÆ���r��r!���r!���r"���r)��3��s����   zPackageIndex._download_htmlc�����������������C���s��t� dt¡�| dd¡d�}d}| ¡� d¡râd|v�râtj |¡\}}}}}} |sâ| d¡râd |d d�…�v�râ|d d�…� d d¡\}}t |ƒ\} } | râd | v�rº|  d d¡\} } d | | f�}nd | �}| }|||||| f}tj  |¡}|�  d||¡�t   d|||f�¡�|S�)Nz"SVN download support is deprecatedr0���r1���r���r¢���zsvn:ú@z//r,���rW���ú:z --username=%s --password=%sz --username=z'Doing subversion checkout from %s to %szsvn checkout%s -q %s %s)Úwarningsr¿���Ú UserWarningr5���r&���r(���r2���r���r3���Ú _splituserÚ urlunparser­���rO���Úsystem)rw���r6���rP���Zcredsr8���Únetlocr:���rT���Úqr¼���ÚauthÚhostÚuserZpwr7���r!���r!���r"���r$��B��s&����   zPackageIndex._download_svnc�����������������C���sp���t�j |�¡\}}}}}| dd¡d�}| dd¡d�}d�}d|v�rR| dd¡\}}t�j ||||df¡}�|�|fS�)Nú+r1���r-���r0���r���r*��r¢���)r2���r���Úurlsplitr5���ÚrsplitÚ urlunsplit)r6���Ú pop_prefixr8���r1��r:���r<���rß���Úrevr!���r!���r"���Ú_vcs_split_rev_from_urlX��s����z$PackageIndex._vcs_split_rev_from_urlc�����������������C���sl���| �dd¡d�}|�j|dd\}}|� d||¡�t d||f�¡�|d�urh|� d|¡�t d ||f�¡�|S�) Nr0���r1���r���T©r:��zDoing git clone from %s to %szgit clone --quiet %s %szChecking out %szgit -C %s checkout --quiet %s©r5���r<��r­���rO���r0��©rw���r6���rP���r;��r!���r!���r"���r%��j��s���� þzPackageIndex._download_gitc�����������������C���sl���| �dd¡d�}|�j|dd\}}|� d||¡�t d||f�¡�|d�urh|� d|¡�t d ||f�¡�|S�) Nr0���r1���r���Tr=��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&��z��s���� þzPackageIndex._download_hgc�����������������G���s���t�j|g|¢R�Ž��d�S�r\���)r���r«���râ���r!���r!���r"���r«���Š��s����zPackageIndex.debugc�����������������G���s���t�j|g|¢R�Ž��d�S�r\���)r���r­���râ���r!���r!���r"���r­�����s����zPackageIndex.infoc�����������������G���s���t�j|g|¢R�Ž��d�S�r\���)r���r¿���râ���r!���r!���r"���r¿�����s����zPackageIndex.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.���rö���r���rõ���r ��r��r ��r®���rô���rÛ���r(��r)��r$��Ú staticmethodr<��r%��r&��r«���r­���r¿���Ú __classcell__r!���r!���rë���r"���r�����sR�����þ  5      #��þ L )$ # r���z!&(#(\d+|x[\da-fA-F]+)|[\w.:-]+);?c�����������������C���s���|� �d¡}t |¡S�)Nr���)rC���r ���Zunescape)rB���Zwhatr!���r!���r"���Ú decode_entity™��s���� rB��c�����������������C���s ���t�t|�ƒS�)a�� Decode HTML entities in the given text. >>> htmldecode( ... 'https://../package_name-0.1.2.tar.gz' ... '?tokena=A&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"���rm���ž��s���� rm���c��������������������s���‡�fdd„}|S�)Nc��������������������s���‡�‡fdd„}|S�)Nc��������������� ������s>���t� ¡�}t� ˆ¡�zˆ�|�i�|¤ŽW�t� |¡�S�t� |¡�0�d�S�r\���)r��ZgetdefaulttimeoutZsetdefaulttimeout)r]���r^���Z old_timeout)r`���Útimeoutr!���r"���Ú_socket_timeout¬��s����  þz@socket_timeout.<locals>._socket_timeout.<locals>._socket_timeoutr!���)r`���rF��©rE��r_���r"���rF��«��s����z'socket_timeout.<locals>._socket_timeoutr!���)rE��rF��r!���rG��r"���Úsocket_timeoutª��s���� rH��c�����������������C���s2���t�j |�¡}| ¡�}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¢���)r2���r���r4���ÚencodeÚbase64Z b64encoder¶���r#��)r3��Zauth_sZ auth_bytesZ encoded_bytesZencodedr!���r!���r"���Ú _encode_auth¹��s ����  rL��c�������������������@���s(���e�Zd�ZdZdd„�Zdd„�Zdd„�ZdS�) Ú Credentialz: A username/password pair. Use like a namedtuple. c�����������������C���s���||�_�||�_d�S�r\���©ÚusernameÚpassword)rw���rO��rP��r!���r!���r"���r‰���Ó��s����zCredential.__init__c�����������������c���s���|�j�V��|�jV��d�S�r\���rN��rz���r!���r!���r"���Ú__iter__×��s����zCredential.__iter__c�����������������C���s ���dt�|�ƒ�S�)Nz%(username)s:%(password)s)Úvarsrz���r!���r!���r"���Ú__str__Û��s����zCredential.__str__N)r���r€���r���r‚���r‰���rQ��rS��r!���r!���r!���r"���rM��Î��s���rM��c�������������������@���s0���e�Zd�Zdd„�Zedd„�ƒZdd„�Zdd„�Zd S�) Ú PyPIConfigc�����������������C���sN���t� g�d¢d¡}tj |�|¡�tj tj d¡d¡}tj  |¡rJ|�  |¡�dS�)z% Load from ~/.pypirc )rO��rP��Ú repositoryr¢���ú~z.pypircN) ÚdictÚfromkeysÚ configparserÚRawConfigParserr‰���rO���r:���r[���Ú expanduserr¾���rµ���)rw���ÚdefaultsZrcr!���r!���r"���r‰���à��s ���� zPyPIConfig.__init__c��������������������s&���‡�fdd„ˆ� �¡�D�ƒ}ttˆ�j|ƒƒS�)Nc��������������������s ���g�|�]}ˆ� �|d�¡ ¡�r|‘qS�)rU��)r³���rj���)rS���Úsectionrz���r!���r"���r��í��s���ÿz2PyPIConfig.creds_by_repository.<locals>.<listcomp>)ZsectionsrW��rh���Ú_get_repo_cred)rw���Zsections_with_repositoriesr!���rz���r"���Úcreds_by_repositoryë��s���� ÿzPyPIConfig.creds_by_repositoryc�����������������C���s6���|� �|d¡ ¡�}|t|� �|d¡ ¡�|� �|d¡ ¡�ƒfS�)NrU��rO��rP��)r³���rj���rM��)rw���r]��Zrepor!���r!���r"���r^��ô��s ����þzPyPIConfig._get_repo_credc�����������������C���s*���|�j� ¡�D�]\}}| |¡r |��S�q dS�)zŒ If the URL indicated appears to be a repository defined in this config, return the credential for that repository. N)r_��Úitemsr(���)rw���r6���rU��Úcredr!���r!���r"���Úfind_credentialû��s���� zPyPIConfig.find_credentialN)r���r€���r���r‰���Úpropertyr_��r^��rb��r!���r!���r!���r"���rT��ß��s ���  rT��c�����������������C���s@��t�j |�¡}|\}}}}}}| d¡r2tj d¡‚|dv�rHt|ƒ\} } nd} | s„tƒ�  |�¡} | r„t | ƒ} | j |�f} t j dg| ¢R�Ž��| rÊdt| ƒ�} || ||||f} t�j | ¡}t�j |¡}| d| ¡�n t�j |�¡}| dt¡�||ƒ}| r<t�j |j¡\}}}}}}||kr<|| kr<||||||f} t�j | ¡|_|S�) z4Open a urllib2 request, handling HTTP authenticationr+��znonnumeric port: '')r��ÚhttpsNz*Authenticating as %s for %s (from .pypirc)zBasic Z Authorizationz User-Agent)r2���r���r3���r'���r��r��r��r.��rT��rb��ri���rO��r���r­���rL��r/��rœ���ZRequestZ add_headerÚ user_agentr6���)r6���rž���Úparsedr8���r1��r:���Úparamsr<���rß���r3��Zaddressra��r­���r7���rÞ���rœ���r��Ús2Zh2Zpath2Zparam2Zquery2Zfrag2r!���r!���r"���r����s8����          r��c�����������������C���s ���|� �d¡\}}}�|r|nd|�fS�)zNsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.r*��N)Ú rpartition)r4��r5��Údelimr!���r!���r"���r.��4��s����r.��c�����������������C���s���|�S�r\���r!���)r6���r!���r!���r"���Ú fix_sf_url?��s����rk��c�������������� ���C���s,��t�j |�¡\}}}}}}t�j |¡}tj |¡r<t�j |�¡S�|  d¡rütj  |¡rüg�}t  |¡D�]x} tj  || ¡} | dkr²t | dƒ} |  ¡�} W�d��ƒ�n1�s¢0����Y���qòntj  | ¡rÆ| d7�} | dj| d¡�q`d} | j|�d  |¡d } d \}}n d \}}} d d i}t | ¡}t�j |�||||¡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}{files}rI)r6Úfiles)éÈZOK)r¦zPath not foundz Not foundr¡z text/html)r2rr3rœr'rOr:Úisfilerr'rÀrÂr[rÐrµròÚformatÚioÚStringIOr°r±)r6r8r9r:Zparamr<rßrPrmr¼ÚfilepathrÚbodyr»ZstatusÚmessager²Z body_streamr!r!r"rCs.    & ÿ   r)N)N)N)r)Yr‚ÚsysrOrRrqrrrKr…rËr,rYr Z http.clientrÚ urllib.parser2Zurllib.requestZ urllib.errorÚ functoolsrrZ pkg_resourcesrrrrrr r r r r rrrZ distutilsrZdistutils.errorsrÚfnmatchrZsetuptools.wheelrZ setuptools.extern.more_itertoolsrrrAÚIrkrÜrBr§r5rKÚ__all__Z_SOCKET_TIMEOUTZ_tmplrpÚ version_inforer#rr>rr@rQrrbrdrtrurƒrrÝrCrBrmrHrLrMrZrTrœrrr.rkrr!r!r!r"ÚsŒ <      ÿ ÿ   ! þ #  !  &/