3 M(Y" @sdZddlZddlZddlZddlZddlZddlZddlZddlZddl m Z yddl m Z Wn e k rddlm Z YnXddlmZddlmZmZmZmZddlZddlmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#ddlm$Z$dd l%m&Z&dd l'm(Z(dd l)m*Z*dd l+m,Z,dd l-m.Z.ej/dZ0ej/dej1Z2ej/dZ3ej/dej1j4Z5dj6Z7ddddgZ8dZ9dZ:e:j;ejddZ?ddZ@dGd dZAdHd!d"ZBdId#d$ZCdedfd%dZDdJd&d'ZEd(d)ZFej/d*ej1ZGeFd+d,ZHGd-d.d.eIZJGd/d0d0eJZKGd1ddeZLej/d2jMZNd3d4ZOd5d6ZPd7d8ZQdKd9d:ZRd;d<ZSGd=d>d>eIZTGd?d@d@ejUZVejWjXfdAdBZYeRe9eYZYdCdDZZdEdFZ[dS)Lz#PyPI and direct package downloadingN)wraps) splituser)six)urllib http_client configparsermap) CHECKOUT_DIST Distribution BINARY_DISTnormalize_path SOURCE_DIST Environmentfind_distributions safe_name safe_version to_filename Requirement DEVELOP_DIST) ssl_support)log)DistutilsError) translate)strip_fragment)get_all_headersz^egg=([-A-Za-z0-9_.+!]+)$zhref\s*=\s*['"]?([^'"> ]+)z([^<]+) \s+\(md5\)z([-+.a-z0-9]{2,}):z.tar.gz .tar.bz2 .tar .zip .tgz PackageIndexdistros_for_urlparse_bdist_wininstinterpret_distro_namezsz(interpret_distro_name..r:Nr8) py_versionrIrV)r@anyrangerSr join)rTrUrNr_rIrVrBr]r%r%r&rs  $ccsnt}|j}|dkr>xTtjj|j|D]}|||Vq&Wn,x*|D]"}||}||krD|||VqDWdS)zHList unique elements, preserving order. Remember all elements ever seen.N)setaddrmoves filterfalse __contains__)iterablekeyseenZseen_addelementkr%r%r&unique_everseens  rmcstfdd}|S)zs Wrap a function returning an iterable such that the resulting iterable only ever yields unique items. cst||S)N)rm)argskwargs)funcr%r&wrapperszunique_values..wrapper)r)rprqr%)rpr& unique_valuessrrz(<([^>]*\srel\s*=\s*['"]?([^'">]+)[^>]*)>ccsxvtj|D]h}|j\}}tttj|jjd}d|ksFd|kr x,t j|D]}t j j |t |jdVqRWq WxHdD]@}|j|}|d kr~t j||}|r~t j j |t |jdVq~WdS) zEFind rel="homepage" and rel="download" links in `page`, yielding URLs,Zhomepager9r8 Home PageDownload URLN)rtrur<)RELfinditergroupsrcrstrstripr0r@HREFrr"urljoin htmldecoderMfindsearch)rApagerLtagrelZrelsposr%r%r&find_external_linkss "   rc@s(eZdZdZddZddZddZdS) ContentCheckerzP A null content checker that defines the interface for checking content cCsdS)z3 Feed a block of data to the hash. Nr%)selfblockr%r%r&feedszContentChecker.feedcCsdS)zC Check the hash. Return False if validation fails. Tr%)rr%r%r&is_validszContentChecker.is_validcCsdS)zu Call reporter with information about the checker (hash name) substituted into the template. Nr%)rreportertemplater%r%r&reportszContentChecker.reportN)__name__ __module__ __qualname____doc__rrrr%r%r%r&rsrc@sBeZdZejdZddZeddZddZ dd Z d d Z d S) HashCheckerzK(?Psha1|sha224|sha384|sha256|sha512|md5)=(?P[a-f0-9]+)cCs||_tj||_||_dS)N) hash_namehashlibnewhashexpected)rrrr%r%r&__init__s zHashChecker.__init__cCs>tjj|d}|stS|jj|}|s0tS|f|jS)z5Construct a (possibly null) ContentChecker from a URLr8r<)rr"r>rpatternr groupdict)clsrArGrLr%r%r&from_url s zHashChecker.from_urlcCs|jj|dS)N)rupdate)rrr%r%r&rszHashChecker.feedcCs|jj|jkS)N)r hexdigestr)rr%r%r&rszHashChecker.is_validcCs||j}||S)N)r)rrrmsgr%r%r&rs zHashChecker.reportN) rrrr[compilerr classmethodrrrrr%r%r%r&rs rcs<eZdZdZdKddZdLd d ZdMd d ZdNd dZddZddZ ddZ ddZ dOddZ ddZ dPfdd ZddZdd Zd!d"Zd#d$Zd%d&ZdQd'd(ZdRd)d*Zd+d,Zd-Zd.d/Zd0d1ZdSd2d3Zd4d5Zd6d7Zd8d9Zd:d;Zdd?Z!d@dAZ"dBdCZ#dDdEZ$dFdGZ%dHdIZ&Z'S)Urz;A distribution index that scans web pages for download URLshttps://pypi.python.org/simple*NTcOstj|f|||dd|jd |_i|_i|_i|_tjdj t t |j |_ g|_|ortjor|prtj}|rtj||_n tjj|_dS)Nr7|)rrr1 index_url scanned_urls fetched_urls package_pagesr[rrbrrrLallowsto_scanrZ is_availableZfind_ca_bundleZ opener_foropenerrrequesturlopen)rrhostsZ ca_bundleZ verify_sslrnkwZuse_sslr%r%r&r$s zPackageIndex.__init__Fc Cs||jkr| rdSd|j|<t|s4|j|dStt|}|r^|j|sRdS|jd||sr| sr||jkrtt|j |dS|j|sd|j|<dS|j d|d|j|<d}|j |||}|dkrdSd|j|j <d|j jddjkr|jdS|j }|j}t|tsRt|tjjr4d }n|j jd pDd }|j|d }|jx6tj|D](} tjj|t| jd } |j| qfW|j |j!rt"|d ddkr|j#||}dS)zrr)rrAfatalsis_filerr%r%r&r{szPackageIndex.url_okcCs2ttjj|}dd|D}ttj|j|dS)Ncss0|](}tj|D]}|jdr||fVqqdS)z .egg-linkN)rXrr1)r\rEentryr%r%r&r^sz.PackageIndex.scan_egg_links..)filterrXrErr itertoolsstarmap scan_egg_link)r search_pathdirsZ egg_linksr%r%r&scan_egg_linksszPackageIndex.scan_egg_linksc Csttjj||}ttdttj|}WdQRXt |dkrDdS|\}}x>t tjj||D](}tjj|f||_ t |_ |j|q`WdS)Nr:)openrXrErbrrrryrzrSrrTr rIrd)rrErZ raw_lineslinesZegg_pathZ setup_pathrOr%r%r&rs  zPackageIndex.scan_egg_linkc sfdd}xHtj|D]:}y |tjj|t|jdWqtk rPYqXqW||\}}|rxXt||D]J}t |\}} |j dr| r|r|d||f7}n j |j |qrWt jdd|SdSd S) z#Process the contents of a PyPI pagecs|jjrtttjj|tjdjd}t|dkrd|dkrt |d}t |d}dj j |j i|<t|t|fSdS)Nr7r:r;r8rT)NN)r2rrrrr"r?rSr@rrr setdefaultr0r)rrBpkgver)rr%r&scans "  z(PackageIndex.process_index..scanr8z.pyz #egg=%s-%scSsd|jdddS)Nz%sr8r r:)rM)mr%r%r&sz,PackageIndex.process_index..rN)r{rwrr"r|r}rMr#rrHr1need_version_infoscan_urlPYPI_MD5sub) rrArrrLrrnew_urlr4fragr%)rr&rs$       zPackageIndex.process_indexcCs|jd|dS)NzPPage at %s links to .py file(s) without version info; an index scan is required.)scan_all)rrAr%r%r&rszPackageIndex.need_version_infocGs:|j|jkr*|r |j|f||jd|j|jdS)Nz6Scanning index of all packages (this may take a while))rrrrr)rrrnr%r%r&rs  zPackageIndex.scan_allcCs~|j|j|jd|jj|js:|j|j|jd|jj|jsR|j|x&t|jj|jfD]}|j|qhWdS)Nr7) rr unsafe_namerrri project_namenot_found_in_indexr)r requirementrAr%r%r& find_packagess zPackageIndex.find_packagescsR|j|j|x,||jD]}||kr.|S|jd||qWtt|j||S)Nz%s does not match %s)prescanrrirsuperrobtain)rr installerrO) __class__r%r&rs zPackageIndex.obtaincCsL|j|jd||jsH|jtj|td|jjtj j |fdS)z- checker is a ContentChecker zValidating %%s checksum for %sz7%s validation failed for %s; possible download problem?N) rrrrrXunlinkrrr3rErU)rcheckerrYtfpr%r%r& check_hashs  zPackageIndex.check_hashcCsTxN|D]F}|jdks4t| s4|jds4tt|r@|j|q|jj|qWdS)z;Add `urls` to the list that will be prescanned for searchesNzfile:)rrr2rrrappend)rurlsrAr%r%r&add_find_linkss      zPackageIndex.add_find_linkscCs"|jrtt|j|jd|_dS)z7Scan urls scheduled for prescanning (e.g. --find-links)N)rrrr)rr%r%r&rszPackageIndex.prescancCs<||jr|jd}}n |jd}}|||j|jdS)Nz#Couldn't retrieve index page for %rz3Couldn't find index page for %r (maybe misspelled?))rirrrr)rrmethrr%r%r&rs   zPackageIndex.not_found_in_indexcCs~t|tsjt|}|rR|j|jd||}t|\}}|jdrN|j|||}|Stj j |rb|St |}t |j ||ddS)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. r8z.pyrTN)rrr _download_urlrMrHr1 gen_setuprXrErr'rfetch_distribution)rr$tmpdirrCfoundr4rGr%r%r&r9 s    zPackageIndex.downloadc sjd|id}d fdd }|rHjj|||}| r`|dk r`|||}|dkrjdk rzj||}|dkr| rj|||}|dkrˆjdrdpd|njd||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 }xz||jD]l}|jtkrJ rJ|krjd|d|<q||kr|jtksb rj|j|_tj j |jr|SqWdS)Nz&Skipping development or system egg: %sr8) rirIrrr r9rTdownload_locationrXrEr)reqenvrO) develop_okrskippedsourcerr%r&r~[s z-PackageIndex.fetch_distribution..findz:No local packages or working download links found for %s%sza source distribution of rzBest match: %s)rT)N)rrrrrcloner) rrr force_scanr r Z local_indexrOr~r%)r rr r rr&rBs0       zPackageIndex.fetch_distributioncCs"|j||||}|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)rrT)rrrr r rOr%r%r&fetchszPackageIndex.fetchc Cstj|}|r*ddt||jddDp,g}t|dkrtjj|}tjj||krtjj ||}ddl m }|||st j |||}ttjj |dd2} | jd|dj|djtjj|dfWdQRX|S|rtd ||fntd dS) NcSsg|]}|jr|qSr%)version)r\dr%r%r& sz*PackageIndex.gen_setup..r8r)samefilezsetup.pywzIfrom setuptools import setup setup(name=%r, version=%r, py_modules=[%r]) zCan'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.)rKrLrrMrSrXrErUdirnamerbZsetuptools.command.easy_installrshutilcopy2rwriterrsplitextr) rrYrGrrLrrUdstrrr%r%r&rs2       zPackageIndex.gen_setupi c Cs|jd|d\}}ztj|}|jt|}t|tjjrRt d||j |j f|j}d}|j }d } d|krt |d} ttt| } |j||||| t|dZ} xD|j|} | r|j| | j| |d7}|j||||| qPqW|j||| WdQRX|S|r|jXdS) NzDownloading %szCan't download %s: %s %srr8zcontent-lengthzContent-Lengthwb)NNr<)rrrrrrrrrrrr dl_blocksizermaxrint reporthookrrrrrr) rrArYfprrrblocknumbssizesizesrrr%r%r& _download_tos:       zPackageIndex._download_tocCsdS)Nr%)rrArYr Zblksizer"r%r%r&rszPackageIndex.reporthookcCs|jdrt|Sy t||jSttjfk r}z>djdd|jD}|r^|j ||nt d||fWYdd}~Xnt j j k r}z|Sd}~Xnt j jk r}z,|r|j ||jnt d||jfWYdd}~Xntjk r8}z.|r|j ||jnt d||jfWYdd}~XnPtjtj fk r}z*|rf|j ||nt d||fWYdd}~XnXdS)Nzfile: cSsg|] }t|qSr%)ry)r\argr%r%r&rsz)PackageIndex.open_url..z%s %szDownload error for %s: %sz;%s returned a bad status line. The server might be down, %s)r2 local_openopen_with_authrr#r InvalidURLrbrnrrrrrURLErrorreason BadStatusLineline HTTPExceptionsocket)rrAwarningvrr%r%r&rs6  "zPackageIndex.open_urlcCst|\}}|r4x&d|kr0|jddjdd}qWnd}|jdrN|dd}tjj||}|dksn|jd rz|j||S|d ks|jd r|j||S|jd r|j ||S|d krt j j t j j|dS|j|d|j||SdS)Nz...\_Z__downloaded__z.egg.zipr,svnzsvn+gitzgit+zhg+rr:Tr/)rHreplacer1rXrErbr2 _download_svn _download_git _download_hgrr url2pathnamer"r>r_attempt_download)rrCrArr3rGrYr%r%r&r s$         zPackageIndex._download_urlcCs|j|ddS)NT)r)rrAr%r%r&r'szPackageIndex.scan_urlcCs6|j||}d|jddjkr.|j|||S|SdS)Nrz content-typer)r$rr0_download_html)rrArYrr%r%r&r<*s zPackageIndex._attempt_downloadcCslt|}x@|D]8}|jrtjd|rD|jtj||j||SPqW|jtj|td|dS)Nz ([^- ]+ - )?Revision \d+:zUnexpected HTML page found at ) r���rz���r[���r���r���rX���r���r8��r���)r���rA���r���rY���r���r-��r%���r%���r&���r=��1��s����     zPackageIndex._download_htmlc�������������C���s���|j�ddd�}d}|j�jdrd|krtjj|\}}}}}} | �r|jdrd|d d��kr|d d��j�dd\}}t|\} } | rd | kr| j�d d\} } d | | f�}nd | �}| }|||||| f}tjj|}|�jd ||�t j d|||f��|S�)Nr;���r8���r���r���zsvn:@z//r7���r:���:z --username=%s --password=%sz --username=z'Doing subversion checkout from %s to %szsvn checkout%s -q %s %s) r@���r0���r2���r���r"���r>���r��� urlunparser���rX���system)r���rA���rY���credsrC���netlocrE���r]���qr���authhostuserpwrB���r%���r%���r&���r8��@��s$����   zPackageIndex._download_svnc�������������C���sp���t�jj|�\}}}}}|jddd�}|jddd�}d�}d|krR|jdd\}}t�jj||||df}�|�|fS�)N+r8���r;���r���r>��r���r<���)r���r"���urlsplitr@���rsplit urlunsplit)rA��� pop_prefixrC���rC��rE���rF���r���revr%���r%���r&���_vcs_split_rev_from_urlU��s����z$PackageIndex._vcs_split_rev_from_urlc�������������C���sl���|j�ddd�}|�j|dd\}}|�jd||�tjd||f��|d�k rh|�jd|�tjd ||f��|S�) Nr;���r8���r���T)rM��zDoing git clone from %s to %szgit clone --quiet %s %szChecking out %sz"(cd %s && git checkout --quiet %s))r@���rO��r���rX���rA��)r���rA���rY���rN��r%���r%���r&���r9��g��s����  zPackageIndex._download_gitc�������������C���sl���|j�ddd�}|�j|dd\}}|�jd||�tjd||f��|d�k rh|�jd|�tjd ||f��|S�) Nr;���r8���r���T)rM��zDoing hg clone from %s to %szhg clone --quiet %s %szUpdating to %sz(cd %s && hg up -C -r %s -q))r@���rO��r���rX���rA��)r���rA���rY���rN��r%���r%���r&���r:��w��s����  zPackageIndex._download_hgc�������������G���s���t�j|f|��d�S�)N)r���r���)r���r���rn���r%���r%���r&���r�����s����zPackageIndex.debugc�������������G���s���t�j|f|��d�S�)N)r���r���)r���r���rn���r%���r%���r&���r�����s����zPackageIndex.infoc�������������G���s���t�j|f|��d�S�)N)r���r���)r���r���rn���r%���r%���r&���r�����s����zPackageIndex.warnr���)r���rP��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���r9���r��r��r��r��r$��r��r���r��r���r<��r=��r8�� staticmethodrO��r9��r:��r���r���r��� __classcell__r%���r%���)r���r&���r���!��sL����  2   +   #� D )$ # z!&(#(\d+|x[\da-fA-F]+)|[\w.:-]+);?c�������������C���s(���t�|�ts|�S�|�dkr tj|�S�t|�S�)N���)r���r��r���unichrchr)cr%���r%���r&���uchr��s ����  rW��c�������������C���sd���|�j�d}|jdr(t|dd��d}n4|jdrDt|dd��}ntjjjj||�j�d}t|S�)Nr8���z#xr:���r*���r;���r���) rM���r2���r��r���re��� html_entitiesname2codepointr���rW��)rL���whatr%���r%���r&��� decode_entity��s����   r[��c�������������C���s ���t�t|�S�)z'Decode HTML entities in the given text.) entity_subr[��)textr%���r%���r&���r}�����s����r}���c����������������s����fdd}|S�)Nc����������������s����fdd}|S�)Nc����������� ������s.���t�j�}t�j�z �|�|S�t�j|�X�d�S�)N)r/��getdefaulttimeoutsetdefaulttimeout)rn���ro���Z old_timeout)rp���timeoutr%���r&���_socket_timeout��s ����  z@socket_timeout.<locals>._socket_timeout.<locals>._socket_timeoutr%���)rp���ra��)r`��)rp���r&���ra����s����z'socket_timeout.<locals>._socket_timeoutr%���)r`��ra��r%���)r`��r&���socket_timeout��s���� rb��c�������������C���s2���t�jj|�}|j�}tj|}|j�}|jddS�)aq�� 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  r���)r���r"���r?���encodebase64 encodestringr���r7��)rE��Zauth_sZ auth_bytesZ encoded_bytesencodedr%���r%���r&��� _encode_auth��s ����  rh��c���������������@���s(���e�Zd�ZdZdd�Zdd�Zdd�ZdS�) Credentialz: A username/password pair. Use like a namedtuple. c�������������C���s���||�_�||�_d�S�)N)usernamepassword)r���rj��rk��r%���r%���r&���r�����s����zCredential.__init__c�������������c���s���|�j�V��|�jV��d�S�)N)rj��rk��)r���r%���r%���r&���__iter__��s����zCredential.__iter__c�������������C���s ���dt�|��S�)Nz%(username)s:%(password)s)vars)r���r%���r%���r&���__str__��s����zCredential.__str__N)r���r���r���r���r���rl��rn��r%���r%���r%���r&���ri����s���ri��c���������������@���s0���e�Zd�Zdd�Zedd�Zdd�Zdd�Zd S�) PyPIConfigc�������������C���sP���t�jdddgd}tjj|�|�tjjtjjdd}tjj |rL|�j |�dS�)z% Load from ~/.pypirc rj��rk�� repositoryr���~z.pypircN) dictfromkeysr���RawConfigParserr���rX���rE���rb��� expanduserr���r���)r���defaultsrcr%���r%���r&���r�����s ���� zPyPIConfig.__init__c����������������s&����fdd�j��D�}tt�j|S�)Nc����������������s ���g�|�]}�j�|d�j�r|qS�)rp��)r���rz���)r\���section)r���r%���r&���r����s����z2PyPIConfig.creds_by_repository.<locals>.<listcomp>)sectionsrr��r���_get_repo_cred)r���Zsections_with_repositoriesr%���)r���r&���creds_by_repository��s����zPyPIConfig.creds_by_repositoryc�������������C���s6���|�j�|dj�}|t|�j�|dj�|�j�|dj�fS�)Nrp��rj��rk��)r���rz���ri��)r���rx��repor%���r%���r&���rz����s����zPyPIConfig._get_repo_credc�������������C���s*���x$|�j�j�D�]\}}|j|r |S�q W�dS�)z If the URL indicated appears to be a repository defined in this config, return the credential for that repository. N)r{��itemsr2���)r���rA���rp��credr%���r%���r&���find_credential��s���� zPyPIConfig.find_credentialN)r���r���r���r���propertyr{��rz��r��r%���r%���r%���r&���ro����s��� ro��c�������������C���s6��t�jj|�\}}}}}}|jdr,tjd|d krBt|\}} nd}|szt�j|�} | rzt | }| j |�f} t j d | ��|rdt |�}|| ||||f} t�jj| } t�jj| }|jd|�n t�jj|�}|jd t�||}|r2t�jj|j\}}}}}}||kr2|| kr2||||||f} t�jj| |_|S�) z4Open a urllib2 request, handling HTTP authenticationr?��znonnumeric port: ''httphttpsN*Authenticating as %s for %s (from .pypirc)zBasic Authorizationz User-Agent)r��r��)r��)r���r"���r>���r1���r���r)��r���ro��r��ry���rj��r���r���rh��r@��r���Request add_header user_agentrA���)rA���r���rC���rC��rE���paramsrF���r���rE��rF��r~��r���rB���r���r���r��s2h2path2Zparam2Zquery2Zfrag2r%���r%���r&���r(�� ��s6����         r(��c�������������C���s���|�S�)Nr%���)rA���r%���r%���r&��� fix_sf_url<��s����r��c���������� ���C���s��t�jj|�\}}}}}}t�jj|}tjj|r<t�jj|�S�|j drtjj |rg�}xtj |D�]b} tjj || } | dkrt | d} | j�} W�dQ�R�X�P�ntjj | r| d7�} |jdj| d�qbW�d} | j|�dj |d } d\}}n d\}}} ddi}tj| }t�jj|�||||S�)z7Read a local path, with special support for directoriesr7���z index.htmlrNz<a href="{name}">{name}</a>)r3���zB<html><head><title>{url}{files}rc)rAfilesOKPath not found Not foundz content-typez text/html)rr)rrr)rr"r>rr;rXrEisfilerr1rrrbrrrformatrStringIOrr)rArCrDrEparamrFrrYrrfilepathrbodyrstatusmessagerZ body_streamr%r%r&r'@s,        r')N)N)N)N)r)\rsysrXr[rr/rerr functoolsr urllib.parser ImportErrorurllib2Zsetuptools.externrZsetuptools.extern.six.movesrrrrr! pkg_resourcesr r r r r rrrrrrrr distutilsrZdistutils.errorsrfnmatchrZsetuptools.py26compatrZsetuptools.py27compatrrrKIr{rrLrr@rR__all__Z_SOCKET_TIMEOUTZ_tmplrrrr'rrHrrJrZrrmrrrvrobjectrrrrr\rWr[r}rbrhrirtrorrr(rr'r%r%r%r&s  8            "   !v   &.