a „oeÉ•ã@sˆdZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl 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 .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Ú parse_version)Ú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éz³óz(interpret_distro_name..éNr4)Ú py_versionrBrQ)r8ÚanyÚrangerOÚisdigitrÚjoin)rKrPrGr\rBrQr:rXr#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)rerfr#rdr$Ú unique_valuesÊsrgz3<([^>]*\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 Home PagezDownload 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   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$ÚreportszContentChecker.reportN)Ú__name__Ú __module__Ú __qualname__Ú__doc__r~r€rƒr#r#r#r$rzðsrzc@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 |¡|_||_dSra)Ú hash_nameÚhashlibÚnewÚhashÚexpected)r|r‰rr#r#r$Ú__init__s zHashChecker.__init__cCsBtj |¡d}|stƒS|j |¡}|s0tƒS|fi| ¡¤ŽS)z5Construct a (possibly null) ContentChecker from a URLr0)r5rr6rzÚpatternrtÚ groupdict)Úclsr9r@rEr#r#r$Úfrom_urls zHashChecker.from_urlcCs|j |¡dSra)rŒÚupdater{r#r#r$r~szHashChecker.feedcCs|j ¡|jkSra)rŒZ hexdigestrrr#r#r$r€"szHashChecker.is_validcCs||j}||ƒSra)r‰)r|rr‚Úmsgr#r#r$rƒ%s zHashChecker.reportN) r„r…r†rVÚcompilerrŽÚ classmethodr’r~r€rƒr#r#r#r$rˆ sÿ rˆcsTeZdZdZdN‡fdd„ Z‡fdd „ZdOd d „ZdPd d„ZdQdd„Zdd„Z dd„Z dd„Z dd„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;„Zdd?„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_pagesrVr•r`rmrrEÚallowsÚto_scanr5ÚrequestÚurlopenÚopener)r|rœZhostsZ ca_bundleZ verify_sslrbÚkw©Ú __class__r#r$rŽ-s zPackageIndex.__init__cs0zt|jƒWnty"YdS0tƒ |¡Sra)rrMÚ Exceptionr›Úadd)r|rHr¦r#r$r©?s  zPackageIndex.addFc 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.)ÚfilterrSr=rÉr³Ú itertoolsÚstarmapÚ scan_egg_link)r|Ú 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)Nr[)ÚopenrSr=r`r³rÓrmrnrorOr rKrrBr©)r|r=rÒZ raw_linesÚlinesZegg_pathZ setup_pathrHr#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/r[r3r4rT)r+rœr³rmr5rr7rOr8r r 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%sr4ér[)rF)Úmr#r#r$ÚàrZz,PackageIndex.process_index..)rprjrßr5rrqrrrFr ryrAr*Úneed_version_infoÚscan_urlÚPYPI_MD5Úsub) r|r9rurErÝ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”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¼ÚkeyrLÚnot_found_in_indexr³)r|Ú requirementr9r#r#r$Ú find_packagesñs zPackageIndex.find_packagescsR| ¡| |¡||jD]"}||vr0|S| d||¡qtt|ƒ ||¡S)Nz%s does not match %s)Úprescanrñrîrµr›rÚobtain)r|rðZ installerrHr¦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½rSÚunlinkrrŒr,r=rP)r|ÚcheckerrTÚ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)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³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. r4ràrKN)r¸rr±Ú _download_urlrFrAr*Ú gen_setuprSr=rÇr%rÁÚfetch_distribution)r|r!Útmpdirr;Úfoundr-r@r#r#r$r17s    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: %sr4) rîrBrrÈrr1rKÚdownload_locationrSr=rÇ)ZreqÚenvrHÚtestÚloc©Ú develop_okr|ZskippedÚsourcerÿr#r$rsws"þz-PackageIndex.fetch_distribution..findz:No local packages or working download links found for %s%sza source distribution of r¬zBest match: %s)rK)N)r¶ròrñr¡rÈZcloner) r|rðrÿÚ force_scanrrZ local_indexrHrsr#rr$rþYs2        ý 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þrK)r|rðrÿrrrHr#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#)rM)rWÚdr#r#r$Ú ¹sþz*PackageIndex.gen_setup..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.)rDrErrFrOrSr=rPÚdirnamer`rÇÚsamefileÚshutilÚcopy2rÚÚwriterLrMÚsplitextr) r|rTr@rÿrErÃrPÚ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ƒn1s0Y|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ÚmaxrmÚintÚ reporthookrÚr¾r~rr÷r½) r|r9rTÚfprõr»ÚblocknumÚbsÚsizeZsizesrör}r#r#r$Ú _download_toåsD   ÿ     .ýÿzPackageIndex._download_tocCsdSrar#)r|r9rTrZblksizerr#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}~0tjjtfy¦}z2|r€|  ||¡nt d||fƒ|‚WYd}~n d}~00dS)Nrøú cSsg|] }t|ƒ‘qSr#)rn)rWÚargr#r#r$r rZz)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`rbrÈ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__rIr(Úsvnzsvn+Úgitzgit+zhg+rÏr[T)rAÚreplacer*rSr=r`r+Ú _download_svnÚ _download_gitÚ _download_hgr5r¢Ú url2pathnamerr6r´Ú_attempt_download)r|r;r9rÿr,r@rTr#r#r$rü/s$        zPackageIndex._download_urlcCs| |d¡dS)NT)rÀrër#r#r$råLszPackageIndex.scan_urlcCs6| ||¡}d| dd¡ ¡vr.| |||¡S|SdS)Nrªr«r¬)rr¼r)Ú_invalid_download_html)r|r9rTr»r#r#r$r3Os zPackageIndex._attempt_downloadcCst |¡td|›ƒ‚dS)NzUnexpected HTML page found at )rSrôr)r|r9r»rTr#r#r$r4Vs z#PackageIndex._invalid_download_htmlcCstd|›ƒ‚dS)Nz/Invalid config, SVN download is not supported: r)r|r9Z _filenamer#r#r$r/ZszPackageIndex._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©r:zDoing git clone from %s to %szgit clone --quiet %s %szChecking out %szgit -C %s checkout --quiet %s©r8r=r¶rSÚsystem©r|r9rTr<r#r#r$r0os þÿÿ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?rAr#r#r$r1‚s þÿÿzPackageIndex._download_hgcGstj|g|¢RŽdSra)rrµrìr#r#r$rµ•szPackageIndex.debugcGstj|g|¢RŽdSra)rr¶rìr#r#r$r¶˜szPackageIndex.infocGstj|g|¢RŽ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ór÷rúròrïr1rþr rýrrrr·rürår3r4r/Ú staticmethodr=r0r1rµr¶rÈÚ __classcell__r#r#r¦r$r*s\û 5      &ù O .$ " rz!&(#(\d+|x[\da-fA-F]+)|[\w.:-]+);?cCs| d¡}t |¡S)Nr)rFrªZunescape)rEZwhatr#r#r$Ú decode_entity¤s rDcCs tt|ƒ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_subrD)Útextr#r#r$rr©s rrcs‡fdd„}|S)Ncs‡‡fdd„}|S)Nc s>t ¡}t ˆ¡zˆ|i|¤ŽWt |¡St |¡0dSra)ÚsocketZgetdefaulttimeoutZsetdefaulttimeout)rbrcZ old_timeout)reÚtimeoutr#r$Ú_socket_timeout·s  þz@socket_timeout.._socket_timeout.._socket_timeoutr#)rerI©rHrdr$rI¶sz'socket_timeout.._socket_timeoutr#)rHrIr#rJr$Úsocket_timeoutµs rKcCs2tj |¡}| ¡}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  rPc@s(eZdZdZdd„Zdd„Zdd„ZdS) Ú Credentialz: A username/password pair. Use like a namedtuple. cCs||_||_dSra©ÚusernameÚpassword)r|rSrTr#r#r$rŽÞszCredential.__init__ccs|jV|jVdSrarRrr#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ŽrUrWr#r#r#r$rQÙsrQcs8eZdZ‡fdd„Zedd„ƒZdd„Zdd„Z‡ZS) Ú PyPIConfigcsLt gd¢d¡}tƒ |¡tj tj d¡d¡}tj |¡rH|  |¡dS)z% Load from ~/.pypirc )rSrTÚ repositoryr¬ú~z.pypircN) ÚdictÚfromkeysr›rŽrSr=r`Ú expanduserrÇr¾)r|ÚdefaultsÚrcr¦r#r$rŽës   zPyPIConfig.__init__cs&‡fdd„ˆ ¡Dƒ}ttˆj|ƒƒS)Ncs g|]}ˆ |d¡ ¡r|‘qS)rY)r¼ro)rWÚsectionrr#r$r øsþz2PyPIConfig.creds_by_repository..)Zsectionsr[rmÚ_get_repo_cred)r|Zsections_with_repositoriesr#rr$Úcreds_by_repositoryös þzPyPIConfig.creds_by_repositorycCs6| |d¡ ¡}|t| |d¡ ¡| |d¡ ¡ƒfS)NrYrSrT)r¼rorQ)r|r`Zrepor#r#r$ras þ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)rbÚitemsr+)r|r9rYÚcredr#r#r$Úfind_credentials zPyPIConfig.find_credential) r„r…r†rŽÚpropertyrbrarerCr#r#r¦r$rXês   rXcCs@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 'user[:passwd]', 'host[:port]'.r6N)Ú rpartition)ÚhostÚuserÚdelimr#r#r$ri@sricCs|Srar#)r9r#r#r$Ú fix_sf_urlKsrsc Cs,tj |¡\}}}}}}tj |¡}tj |¡r{name})r,zB{url}{files}rL)r9Úfiles)éÈZOK)r°zPath not foundz Not foundr«z text/html)r5rr6r¢r2rSr=Úisfiler£r*rÉrËr`rÚr¾rùÚformatÚioÚStringIOr¹rº)r9r;r<r=Zparamr?rérTrurÅÚfilepathrÚbodyrÄÚstatusÚmessager»Z body_streamr#r#r$r Os.    & ÿ   r )N)N)N)r)Yr‡ÚsysrSrVryrrGrNrŠrÔZ configparserrªZ http.clientr"Ú urllib.parser5Zurllib.requestZ urllib.errorÚ functoolsrrZ pkg_resourcesrrrrrr r r r r rrrrZ distutilsrZdistutils.errorsrÚfnmatchrZsetuptools.wheelrZ setuptools.extern.more_itertoolsrr•rDÚIrprærEr±r8rNÚ__all__Z_SOCKET_TIMEOUTZ_tmplrxÚ version_inforkr%rrArrCrUrrgriryrzrˆrrçrErDrrrKrPrQZRawConfigParserrXr¢r£r!rirsr r#r#r#r$Ús† @      ÿ ÿ   # ÿ "  !{  '/