v]c@sdZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z ddlmZmZmZmZddlZddlmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!ddlm"Z"ddl#m$Z$dd l%m&Z&dd l'm(Z(dd l)m*Z*dd l+m,Z,dd l-m.Z.e/Z0ej1dZ2ej1dej3Z4ej1dZ5ej1dej3j6Z7dj8Z9ddddgZ:dZ;dZ<e<j=dej>d deZ?dZ@dZAdZBeCdZDeCd ZEeCd!ZFeCeeCd"ZGeCd#ZHd$ZIej1d%ej3ZJeId&ZKd'fd(YZLd)eLfd*YZMdefd+YZNej1d,jOZPd-ZQd.ZRdd/ZSd0ZTd1fd2YZUd3ejVfd4YZWejXjYd5ZZd6Z[eSe;eZZZd7Z\d8Z]dS(9s#PyPI and direct package downloadingiN(twraps(tsix(turllibt http_clientt configparsertmap( t CHECKOUT_DISTt Distributiont BINARY_DISTtnormalize_patht SOURCE_DISTt Environmenttfind_distributionst safe_namet safe_versiont to_filenamet Requirementt DEVELOP_DISTtEGG_DIST(t ssl_support(tlog(tDistutilsError(t translate(tget_all_headers(tunescape(tWheels^egg=([-A-Za-z0-9_.+!]+)$shref\s*=\s*['"]?([^'"> ]+)s([^<]+)\n\s+\(md5\)s([-+.a-z0-9]{2,}):s.tar.gz .tar.bz2 .tar .zip .tgzt PackageIndextdistros_for_urltparse_bdist_wininsttinterpret_distro_nameis<setuptools/{setuptools.__version__} Python-urllib/{py_major}tpy_majorit setuptoolscCs<ytj|SWn$tk r7td|fnXdS(Ns1Not a URL, existing file, or requirement spec: %r(Rtparset ValueErrorR(tspec((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pytparse_requirement_arg4s  cCs|j}d\}}}|jdr|jdrL|d }d}q|jddr~|dd!}|d }d}q|jd r|d }d }q|jd d r|dd!}|d }d }qn|||fS(s=Return (base,pyversion) or (None,None) for possible .exe names.exes .win32.exeitwin32s .win32-pyiiis.win-amd64.exeis win-amd64s .win-amd64-pyiN(NNN(tlowertNonetendswitht startswith(tnameR%tbasetpy_vertplat((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyR=s$           c Cstjj|}|\}}}}}}tjj|jdd}|dkr|dkrtjj|jdd}nd|kr|jdd\}}n||fS(Nt/issourceforge.nettdownloadit#i(RR turlparsetunquotetsplit( turltpartstschemetservertpatht parameterstquerytfragmentR*((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pytegg_info_for_urlUs" ccst|\}}xt|||D] }|Vq%W|rtj|}|rx1t||jd|dtD] }|VqqWqndS(sEYield egg or source distribution objects that might be found at a URLit precedenceN(R;tdistros_for_locationt EGG_FRAGMENTtmatchRtgroupR(R3tmetadataR*R:tdistR?((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyR`s "c CsA|jdr|d }n|jdrMd|krMtj|||gS|jdrd|krt|}|jsgStd|d|jd|jd td gS|jd rt|\}}}|d k rt ||||t |Snx>t D]6}|j|r|t | }t |||SqWgS( s:Yield egg or source distribution objects based on basenames.egg.zipis.eggt-s.whltlocationt project_nametversionR<is.exeN(R'Rt from_locationRt is_compatibleRERFRRR&RRt EXTENSIONStlen(RDtbasenameRAtwheeltwin_baseR+tplatformtext((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyR=ns.       cCs"tt|tjj||S(sEYield possible egg or source distribution objects based on a filename(R=R tosR7RK(tfilenameRA((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pytdistros_for_filenamesc cs|jd}| r4td|dDr4dSxatdt|dD]F}t||dj|| dj||d|d|d|VqNWdS( sGenerate 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! RCcss!|]}tjd|VqdS(s py\d\.\d$N(treR?(t.0tp((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pys siNit py_versionR<RN(R2tanytrangeRJRtjoin(RDRKRARVR<RNR4RU((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyRs! ) ccst}|j}|dkrSxmtjj|j|D]}|||Vq7Wn;x8|D]0}||}||krZ|||VqZqZWdS(sHList unique elements, preserving order. Remember all elements ever seen.N(tsettaddR&Rtmovest filterfalset __contains__(titerabletkeytseentseen_addtelementtk((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pytunique_everseens         cstfd}|S(ss Wrap a function returning an iterable such that the resulting iterable only ever yields unique items. cst||S(N(Re(targstkwargs(tfunc(s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pytwrappers(R(RhRi((Rhs>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyt unique_valuesss(<([^>]*\srel\s*=\s*['"]?([^'">]+)[^>]*)>ccsxtj|D]}|j\}}tttj|jjd}d|ksgd|krx=t j|D])}t j j |t |jdVqwWqqWxjd D]b}|j|}|dkrt j||}|rt j j |t |jdVqqqWdS( sEFind rel="homepage" and rel="download" links in `page`, yielding URLst,thomepageR.is Home PagesDownload URLiN(s Home PagesDownload URL(tRELtfinditertgroupsRZRtstrtstripR%R2tHREFRR turljoint htmldecodeR@tfindtsearch(R3tpageR?ttagtreltrelstpos((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pytfind_external_linkss'.  tContentCheckercBs)eZdZdZdZdZRS(sP A null content checker that defines the interface for checking content cCsdS(s3 Feed a block of data to the hash. N((tselftblock((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pytfeedscCstS(sC Check the hash. Return False if validation fails. (tTrue(R~((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pytis_validscCsdS(su Call reporter with information about the checker (hash name) substituted into the template. N((R~treporterttemplate((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pytreports(t__name__t __module__t__doc__RRR(((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyR}s  t HashCheckercBsJeZejdZdZedZdZdZ dZ RS(sK(?Psha1|sha224|sha384|sha256|sha512|md5)=(?P[a-f0-9]+)cCs(||_tj||_||_dS(N(t hash_namethashlibtnewthashtexpected(R~RR((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyt__init__s cCsRtjj|d}|s#tS|jj|}|sBtS||jS(s5Construct a (possibly null) ContentChecker from a URLi(RR R0R}tpatternRvt groupdict(tclsR3R:R?((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pytfrom_urlscCs|jj|dS(N(Rtupdate(R~R((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyRscCs|jj|jkS(N(Rt hexdigestR(R~((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyR"scCs||j}||S(N(R(R~RRtmsg((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyR%s ( RRRStcompileRRt classmethodRRRR(((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyR s    cBsveZdZdd%d&edZedZedZedZ dZ dZ d Z d Z d&d Zd Zd&d ZdZdZdZdZdZeeed&dZeedZdZdZdZdZd&dZdZdZdZdZ dZ!e"edZ#d Z$d!Z%d"Z&d#Z'd$Z(RS('s;A distribution index that scans web pages for download URLsshttps://pypi.org/simple/t*cOstj||||d|jd |_i|_i|_i|_tjdj t t |j |_ g|_|otjo|ptj}|rtj||_ntjj|_dS(NR-t|(R RR't index_urlt scanned_urlst fetched_urlst package_pagesRSRRYRRR?tallowstto_scanRt is_availabletfind_ca_bundlet opener_fortopenerRtrequestturlopen(R~Rthostst ca_bundlet verify_sslRftkwtuse_ssl((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyR-s   '  c Csg||jkr| rdSt|j|/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyRBsP      !     $*cCstjj|s&|jd|dStjj|r| rtjj|}x9tj|D]%}|jtjj||t qaWnt |}|r|j d|t t |j|ndS(Ns Not found: %ss Found: %s(RPR7texiststwarntisdirtrealpathtlistdirRRYRRRRRRR[(R~tfntnestedR7titemR((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyRus& cCst|}|o*|jdjdk}|sR|jtjj|drVtSd}|rut||n|j ||dS(NitfilesN Note: Bypassing %s (disallowed host; see http://bit.ly/2hrImnY for details). ( RR@R%RRR R0RRR(R~R3tfataltstis_fileR((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyRs !%cCsBttjj|}d|D}ttj|j|dS(Ncss@|]6}tj|D] }|jdr||fVqqdS(s .egg-linkN(RPRR'(RTR7tentry((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pys s(tfilterRPR7RRt itertoolststarmapt scan_egg_link(R~t search_pathtdirst egg_links((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pytscan_egg_linkss c Csttjj||(}ttdttj |}WdQXt |dkr[dS|\}}xQt tjj||D]4}tjj|||_ t |_|j|qWdS(Ni(topenRPR7RYRRR&RRpRqRJR RDR R<R[(R~R7Rt raw_linestlinestegg_patht setup_pathRB((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyRs' " c sfd}xWtj|D]F}y,|tjj|t|jdWqtk rdqXqW||\}}|rxyt||D]h}t |\}} |j dr| r|r|d||f7}qj |nj |qWt jd|SdSdS(s#Process the contents of a PyPI pagecs|jjrtttjj|tjjd}t|dkrd|dkrt |d}t |d}t j j |ji|/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pytscans+"is.pys #egg=%s-%scSsd|jdddS(Ns%siii(R@(tm((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pytRRN(RrRnRR RsRtR@R!R|R;R'tneed_version_infotscan_urltPYPI_MD5tsub( R~R3RwRR?RRtnew_urlR*tfrag((R~s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyRs$,  cCs|jd|dS(NsPPage at %s links to .py file(s) without version info; an index scan is required.(tscan_all(R~R3((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyRscGsO|j|jkr;|r+|j||n|jdn|j|jdS(Ns6Scanning index of all packages (this may take a while)(RRRRR(R~RRf((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyRs  cCs|j|j|jd|jj|jsN|j|j|jdn|jj|jss|j|nx3t|jj|jdD]}|j|qWdS(NR-(( RRt unsafe_nameRRR`REtnot_found_in_indexR(R~t requirementR3((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyt find_packagess%cCsk|j|j|x8||jD])}||kr;|S|jd||q%Wtt|j||S(Ns%s does not match %s(tprescanRR`RtsuperRtobtain(R~Rt installerRB((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyRs   cCsi|j|jd||jse|jtj|td|jjtj j |fndS(s- checker is a ContentChecker sValidating %%s checksum for %ss7%s validation failed for %s; possible download problem?N( RRRRRPtunlinkRRR)R7RK(R~tcheckerRQttfp((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyt check_hashs    cCsrxk|D]c}|jdksJt| sJ|jdsJtt|rZ|j|q|jj|qWdS(s;Add `urls` to the list that will be prescanned for searchessfile:N(RR&RR(RRRtappend(R~turlsR3((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pytadd_find_linkss  cCs2|jr%tt|j|jnd|_dS(s7Scan urls scheduled for prescanning (e.g. --find-links)N(RRRRR&(R~((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyRs cCsN||jr |jd}}n|jd}}|||j|jdS(Ns#Couldn't retrieve index page for %rs3Couldn't find index page for %r (maybe misspelled?)(R`RRRR(R~RtmethR((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyR#s   cCst|tst|}|r||j|jd||}t|\}}|jdrx|j|||}n|Stj j |r|St |}nt |j ||ddS(sLocate 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. is.pyRDN(RRRt _download_urlR@R;R't gen_setupRPR7RR#Rtfetch_distributionR&(R~R"ttmpdirR5tfoundR*R:((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyR.-s c sFjd|id}dfd}|rfjj|||}n| r|dk r|||}n|dkrjdk rjn||}n|dkr| rj|||}n|dkrjdrdpd|n#jd||jd|jSdS( s|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. sSearching for %scs|dkr}nx||jD]}|jtkrn rn|kr#jd|d|/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyRugs        s:No local packages or working download links found for %s%ssa source distribution of RsBest match: %sRDN(RR&RRRRtcloneR( R~RRt force_scanR R t local_indexRBRu((R R~R R Rs>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyROs0       cCs/|j||||}|dk r+|jSdS(s3Obtain 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(RR&RD(R~RRRR RB((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pytfetchs c Csptj|}|rLgt||jddD]}|jr1|^q1pOg}t|dkrAtjj |}tjj ||krtjj ||}ddl m } | ||stj|||}qnttjj |dd?} | jd|dj|djtjj|dfWdQX|S|r`td||fn td dS( Nii(tsamefilessetup.pytwsIfrom setuptools import setup setup(name=%r, version=%r, py_modules=[%r]) isCan't unambiguously interpret project/version identifier %r; any dashes in the name or version should be escaped using underscores. %rspCan't process plain .py files without an '#egg=name-version' suffix to enable automatic setup script generation.(R>R?RR@R&RFRJRPR7RKtdirnameRYtsetuptools.command.easy_installRtshutiltcopy2RtwriteREtsplitextR( R~RQR:RR?tdRRKtdstRR((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyRs24 !!i c Cs|jd|d}zXtj|}|j|}t|tjjrnt d||j |j fn|j}d}|j }d}d|krt |d} ttt| }|j|||||nt|d}} x`trO|j|} | rK|j| | j| |d7}|j|||||qPqW|j||| WdQX|SWd|r|jnXdS( NsDownloading %ssCan't download %s: %s %siiscontent-lengthsContent-Lengthtwbi(RR&RRRRRRRRRRt dl_blocksizeRtmaxRtintt reporthookRRRRRRR( R~R3RQtfpRRtblocknumtbstsizetsizesRR((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyt _download_tos:       cCsdS(N((R~R3RQR!tblksizeR#((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyRscCs|jdrt|Syt||jSWnsttjfk r}djg|jD]}t |^qX}|r|j ||qt d||fnt j jk r}|St j jk r }|r|j ||jqt d||jfntjk rU}|r9|j ||jqt d||jfnNtjtj fk r}|r|j ||qt d||fnXdS(Nsfile:t s%s %ssDownload error for %s: %ss;%s returned a bad status line. The server might be down, %s(R(t local_opentopen_with_authRR!Rt InvalidURLRYRfRpRRRRRtURLErrortreasont BadStatusLinetlinet HTTPExceptiontsocket(R~R3twarningtvtargR((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyRs6 +cCsHt|\}}|rLx7d|krH|jddjdd}qWnd}|jdrn|d }ntjj||}|dks|jd r|j||S|d ks|jd r|j||S|jd r|j ||S|d kr$t j j t j j|dS|j|t|j||SdS(Ns..t.s\t_t__downloaded__s.egg.zipitsvnssvn+tgitsgit+shg+Ri(R;treplaceR'RPR7RYR(t _download_svnt _download_gitt _download_hgRRt url2pathnameR R0RRt_attempt_download(R~R5R3RR)R:RQ((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyRs$%   cCs|j|tdS(N(RR(R~R3((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyR:scCsK|j||}d|jddjkrC|j|||S|SdS(NRs content-typeR(R%RR%t_download_html(R~R3RQR((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyR>=scCst|}xW|D]O}|jrtjd|r^|jtj||j||SPqqW|jtj|td|dS(Ns ([^- ]+ - )?Revision \d+:s���Unexpected HTML page found at ( ���R���Rq���RS���Rv���R���RP���R���R:��R���(���R~���R3���R���RQ���R���R.��(����(����s>���/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyR?��D��s����       c���������C���sv��t��j�d�t��|�j�d�d��d�}�d�}�|�j���j�d��rEd�|�k�rEt�j�j�|��\�}�}�}�}�}�} �|� rE|�j�d��rEd �|�d �k�rE|�d �j�d �d��\�}�}�t �|��\�} �} �| �rBd �| �k�r| �j�d �d��\�} �} �d �| �| �f�}�n �d �| �}�| �}�|�|�|�|�|�| �f�}�t�j�j �|��}�qBqEn��|��j �d�|�|��t �j �d�|�|�|�f��|�S(���Ns"���SVN download support is deprecatedR/���i���i����R���s���svn:t���@s���//R-���i���t���:s��� --username=%s --password=%ss ��� --username=s'���Doing subversion checkout from %s to %ss���svn checkout%s -q %s %s(���t���warningsR���t ���UserWarningR2���R%���R(���R���R ���R0���t ���_splitusert ���urlunparseR���RP���t���system(���R~���R3���RQ���t���credsR5���t���netlocR7���RU���t���qR���t���autht���hostt���usert���pwR4���(����(����s>���/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyR:��S��s&����!$&  c���������C���s���t��j�j�|���\�}�}�}�}�}�|�j�d�d��d�}�|�j�d�d��d�}�d��}�d�|�k�rz�|�j�d�d��\�}�}�n��t��j�j�|�|�|�|�d�f��}��|��|�f�S(���Nt���+i���iR/���i����R@��R���(���R���R ���t���urlsplitR2���R&���t���rsplitt ���urlunsplit(���R3���t ���pop_prefixR5���RH��R7���R9���R���t���rev(����(����s>���/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyt���_vcs_split_rev_from_urli��s����! !c���������C���s���|�j��d�d��d�}�|��j�|�d�t�\�}�}�|��j�d�|�|��t�j�d�|�|�f��|�d��k �r�|��j�d�|��t�j�d�|�|�f��n��|�S( ���NR/���i���i����RR��s���Doing git clone from %s to %ss���git clone --quiet %s %ss���Checking out %ss���git -C %s checkout --quiet %s(���R2���RT��R���R���RP���RF��R&���(���R~���R3���RQ���RS��(����(����s>���/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyR;��{��s����  c���������C���s���|�j��d�d��d�}�|��j�|�d�t�\�}�}�|��j�d�|�|��t�j�d�|�|�f��|�d��k �r�|��j�d�|��t�j�d�|�|�f��n��|�S( ���NR/���i���i����RR��s���Doing hg clone from %s to %ss���hg clone --quiet %s %ss���Updating to %ss���hg --cwd %s up -C -r %s -q(���R2���RT��R���R���RP���RF��R&���(���R~���R3���RQ���RS��(����(����s>���/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyR<����s����  c���������G���s���t��j�|�|��d��S(���N(���R���R���(���R~���R���Rf���(����(����s>���/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyR�����s����c���������G���s���t��j�|�|��d��S(���N(���R���R���(���R~���R���Rf���(����(����s>���/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyR�����s����c���������G���s���t��j�|�|��d��S(���N(���R���R���(���R~���R���Rf���(����(����s>���/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyR�����s����(���R���N()���R���R���R���R&���R���R���t���FalseR���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:��t ���staticmethodRT��R;��R<��R���R���R���(����(����(����s>���/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyR���*��sL��� 3   +      #J ) $  #         s!���&(#(\d+|x[\da-fA-F]+)|[\w.:-]+);?c���������C���s���|��j��d��}�t�|��S(���Ni����(���R@���R���(���R?���t���what(����(����s>���/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyt ���decode_entity��s����c���������C���s ���t��t�|���S(���s�� 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' (���t ���entity_subRX��(���t���text(����(����s>���/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyRt�����s���� c������������s�����f�d���}�|�S(���Nc������������s������f�d���}�|�S(���Nc�������������s?���t��j���}�t��j���z���|��|���SWd��t��j�|��Xd��S(���N(���R0��t���getdefaulttimeoutt���setdefaulttimeout(���Rf���Rg���t ���old_timeout(���Rh���t���timeout(����s>���/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyt���_socket_timeout��s ����  (����(���Rh���R_��(���R^��(���Rh���s>���/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyR_����s����(����(���R^��R_��(����(���R^��s>���/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyt���socket_timeout��s���� c���������C���sI���t��j�j�|���}�|�j���}�t�j�|��}�|�j���}�|�j�d�d��S(���sq�� A function compatible with Python 2.3-3.3 that will 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 s��� R���(���R���R ���R1���t���encodet���base64t ���b64encodeR���R9��(���RJ��t���auth_st ���auth_bytest ���encoded_bytest���encoded(����(����s>���/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyt ���_encode_auth��s ����   t ���Credentialc�����������B���s)���e��Z�d��Z�d���Z�d���Z�d���Z�RS(���s:��� A username/password pair. Use like a namedtuple. c���������C���s���|�|��_��|�|��_�d��S(���N(���t���usernamet���password(���R~���Rj��Rk��(����(����s>���/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyR�����s���� c���������c���s���|��j��V|��j�Vd��S(���N(���Rj��Rk��(���R~���(����(����s>���/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyt���__iter__��s����c���������C���s���d�t��|���S(���Ns���%(username)s:%(password)s(���t���vars(���R~���(����(����s>���/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyt���__str__��s����(���R���R���R���R���Rl��Rn��(����(����(����s>���/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyRi����s���  t ���PyPIConfigc�����������B���s2���e��Z�d����Z�e�d����Z�d���Z�d���Z�RS(���c���������C���su���t��j�d�d�d�g�d��}�t�j�j�|��|��t�j�j�t�j�j�d��d��}�t�j�j �|��rq�|��j �|��n��d�S(���s%��� Load from ~/.pypirc Rj��Rk��t ���repositoryR���t���~s���.pypircN( ���t���dictt���fromkeysR���t���RawConfigParserR���RP���R7���RY���t ���expanduserR���R���(���R~���t���defaultst���rc(����(����s>���/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyR�����s ����!c���������C���sM���g��|��j����D]$�}�|��j�|�d��j���r �|�^�q �}�t�t�|��j�|���S(���NRp��(���t���sectionsR���Rq���Rr��R���t���_get_repo_cred(���R~���t���sectiont���sections_with_repositories(����(����s>���/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyt���creds_by_repository��s����$c���������C���sO���|��j��|�d��j���}�|�t�|��j��|�d��j���|��j��|�d��j����f�S(���NRp��Rj��Rk��(���R���Rq���Ri��(���R~���Rz��t���repo(����(����s>���/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyRy����s����c���������C���s7���x0�|��j��j���D]�\�}�}�|�j�|��r�|�Sq�Wd�S(���s��� If the URL indicated appears to be a repository defined in this config, return the credential for that repository. N(���R|��t���itemsR(���(���R~���R3���Rp��t���cred(����(����s>���/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyt���find_credential ��s����(���R���R���R���t���propertyR|��Ry��R��(����(����(����s>���/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyRo����s���  c���������C���s��t��j�j�|���}�|�\�}�}�}�}�}�}�|�j�d��rK�t�j�d���n��|�d �k�rl�t�|��\�} �} �n�d �} �| �s�t���j �|���} �| �r�t �| ��} �| �j �|��f�} �t �j �d�| ��q�n��| �r&d�t�| ��} �|�| �|�|�|�|�f�} �t��j�j�| ��}�t��j�j�|��}�|�j�d�| ��n�t��j�j�|���}�|�j�d�t��|�|��}�| �rt��j�j�|�j��\�}�}�}�}�}�}�|�|�k�r|�| �k�r|�|�|�|�|�|�f�} �t��j�j�| ��|�_�qn��|�S( ���s4���Open a urllib2 request, handling HTTP authenticationRA��s���nonnumeric port: ''t���httpt���httpss*���Authenticating as %s for %s (from .pypirc)s���Basic t ���Authorizations ���User-Agent(���R��R��N(���R���R ���R0���R'���R���R*��RD��R&���Ro��R��Rp���Rj��R���R���Rh��RE��R���t���Requestt ���add_headert ���user_agentR3���(���R3���R���t���parsedR5���RH��R7���t���paramsR9���R���RJ��t���addressR��R���R4���R���R���R ��t���s2t���h2t���path2t���param2t���query2t���frag2(����(����s>���/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyR)����s8����   'c���������C���s.���|��j��d��\�}�}�}��|�r$�|�n�d�|��f�S(���sJ���splituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.R@��N(���t ���rpartitionR&���(���RK��RL��t���delim(����(����s>���/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyRD��F��s����c���������C���s���|��S(���N(����(���R3���(����(����s>���/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyt ���fix_sf_urlP��s����c���������C���s��t��j�j�|���\�}�}�}�}�}�}�t��j�j�|��}�t�j�j�|��rX�t��j�j�|���S|�j �d��rPt�j�j �|��rPg��}�x�t�j �|��D]�} �t�j�j �|�| ��} �| �d�k�r�t �| �d���} �| �j���} �Wd�QXPn�t�j�j �| ��r�| �d�7} �n��|�j�d�j�d�| ���q�Wd�} �| �j�d�|��d �d �j �|���} �d�\�}�}�n�d�\�}�}�} �i�d�d�6}�t�j�| ��}�t��j�j�|��|�|�|�|��S(���s7���Read a local path, with special support for directoriesR-���s ���index.htmlt���rNs���<a href="{name}">{name}</a>R)���sB���<html><head><title>{url}{files}R3tfiless itOKisPath not founds Not founds text/htmls content-type(iR(isPath not founds Not found(RR R0RR=RPR7tisfileRR'RRRYRRRtformatRtStringIORR(R3R5R6R7tparamR9RRQRRtfilepathR tbodyRtstatustmessageRt body_stream((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyR(Ts,$!  ! (^RtsysRPRSRR0RbRRRBt functoolsRtsetuptools.externRtsetuptools.extern.six.movesRRRRRt pkg_resourcesRRRR R R R R RRRRRRt distutilsRtdistutils.errorsRtfnmatchRtsetuptools.py27compatRtsetuptools.py33compatRtsetuptools.wheelRttypet __metaclass__RR>tIRrRR?RR2RIt__all__t_SOCKET_TIMEOUTt_tmplRRFRR#RR;R&RR=RRRReRjRmR|R}RRRRYRXRtR`RhRiRtRoRRR)RDRR((((s>/tmp/pip-install-vZZv26/setuptools/setuptools/package_index.pyts|         " X       !  "  !   &/