Your IP : 3.147.6.122


Current Path : /opt/alt/python33/lib/python3.3/site-packages/setuptools/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib/python3.3/site-packages/setuptools/__pycache__/package_index.cpython-33.pyc

�
�Re
�c@s�dZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZmZm
Z
mZmZmZmZmZmZmZmZmZmZddlmZddlmZddlmZddlmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-dd	lm.Z.dd
l/m0Z0ddl1m2Z2ddl3m4Z4ej5d
�Z6ej5dej7�Z8ej5d�Z9ej5dej7�j:Z;dj<�Z=ddddgZ>dZ?dd�Z@dd�ZAeBdd�ZCeBdd�ZDeBdd�ZEeBeeBdd�ZFeBd d!�ZGd"d#�ZHej5d$ej7�ZIeHd%d&��ZJd'ejKdd(�ed)�djKfZLGd*d+�d+eM�ZNGd,d-�d-eN�ZOGd.d�de�ZPej5d/�jQZRd0d1�ZSd2d3�ZTd4d5�ZUdd6d7�ZVd8d9�ZWGd:d;�d;eM�ZXGd<d=�d=e-j-�ZYejZd>d?�Z[eVe?�e[�Z[d@dA�Z\dBdC�Z]dS(Du#PyPI and direct package downloadingiN(uwraps(
u
CHECKOUT_DISTuDistributionuBINARY_DISTunormalize_pathuSOURCE_DISTurequireuEnvironmentufind_distributionsu	safe_nameusafe_versionuto_filenameuRequirementuDEVELOP_DIST(ussl_support(ulog(uDistutilsError(uurllib2uhttplibuStringIOu	HTTPErroruurlparseu
urlunparseuunquoteu	splituseruurl2pathnameuname2codepointuunichruurljoinuurlsplitu
urlunsplituConfigParser(ufilterfalse(u	translate(ustrip_fragment(uget_all_headersu^egg=([-A-Za-z0-9_.]+)$uhref\s*=\s*['"]?([^'"> ]+)u�<a href="([^"#]+)">([^<]+)</a>
\s+\(<a (?:title="MD5 hash"
\s+)href="[^?]+\?:action=show_md5&amp;digest=([0-9a-f]{32})">md5</a>\)u([-+.a-z0-9]{2,}):u.tar.gz .tar.bz2 .tar .zip .tgzuPackageIndexudistros_for_urluparse_bdist_wininstuinterpret_distro_nameicCs|j�}d\}}}|jd�r�|jd�rR|dd�}d}q�|jdd�r�|dd�}|dd�}d}q�|jd
�r�|dd�}d}q�|jd
d�r�|dd�}|dd�}d}q�n|||fS(u=Return (base,pyversion) or (None,None) for possible .exe nameu.exeu
.win32.exeNi
uwin32u	.win32-pyiiiu.win-amd64.exeiu	win-amd64u
.win-amd64-pyi(NNNi����i�i����i����i�i�i��i����i����i��(uloweruNoneuendswithu
startswith(unameulowerubaseupy_veruplat((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyuparse_bdist_wininst.s$			cCs�t|�\}}}}}}t|jd�d�}|dkrk|dkrkt|jd�d�}nd|kr�|jdd�\}}n||fS(	Nu/iusourceforge.netudownloadiu#i����i����(uurlparseuunquoteusplit(uurluschemeuserverupathu
parametersuqueryufragmentubase((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyuegg_info_for_urlFsuegg_info_for_urlccs�t|�\}}xt|||�D]}|Vq%W|r�tj|�}|r�x1t||jd�|dt�D]}|VqqWq�ndS(uEYield egg or source distribution objects that might be found at a URLiu
precedenceN(uegg_info_for_urludistros_for_locationuEGG_FRAGMENTumatchuinterpret_distro_nameugroupu
CHECKOUT_DIST(uurlumetadataubaseufragmentudistumatch((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyudistros_for_urlNs	"cCs�|jd�r"|dd�}n|jd�rSd|krStj|||�gS|jd�r�t|�\}}}|dk	r�t||||t|�SnxDtD]<}|j|�r�|dt|��}t|||�Sq�WgS(u:Yield egg or source distribution objects based on basenameu.egg.zipNiu.eggu-u.exei����(	uendswithuDistributionu
from_locationuparse_bdist_wininstuNoneuinterpret_distro_nameuBINARY_DISTu
EXTENSIONSulen(ulocationubasenameumetadatauwin_baseupy_veruplatformuext((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyudistros_for_locationZs
udistros_for_locationcCs"tt|�tjj|�|�S(uEYield possible egg or source distribution objects based on a filename(udistros_for_locationunormalize_pathuosupathubasename(ufilenameumetadata((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyudistros_for_filenameosudistros_for_filenamec	cs�|jd�}|sdxLt|dd��D]1\}}t|�dkr,|jd�r,dSq,Wnxmtdt|�d�D]R}t||dj|d|��dj||d��d|d|d	|�Vq~WdS(
u�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!
    u-iNiupy2.iu
py_versionu
precedenceuplatform(usplitu	enumerateulenu
startswithurangeuDistributionujoin(	ulocationubasenameumetadatau
py_versionu
precedenceuplatformupartsuiup((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyuinterpret_distro_namevs#! 5ccs�t�}|j}|dkrMxgt|j|�D]}||�|Vq1Wn;x8|D]0}||�}||krT||�|VqTqTWdS(uHList unique elements, preserving order. Remember all elements ever seen.N(usetuadduNoneufilterfalseu__contains__(uiterableukeyuseenuseen_adduelementuk((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyuunique_everseen�s		


uunique_everseencs"t���fdd��}|S(us
    Wrap a function returning an iterable such that the resulting iterable
    only ever yields unique items.
    cst�||��S(N(uunique_everseen(uargsukwargs(ufunc(u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyuwrapper�suunique_values.<locals>.wrapper(uwraps(ufuncuwrapper((ufuncu1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu
unique_values�su
unique_valuesu(<([^>]*\srel\s*=\s*['"]?([^'">]+)[^>]*)>ccsx�tj|�D]�}|j�\}}tttj|j�jd���}d|ksgd|krx7t	j|�D]#}t
|t|jd���VqwWqqWxddD]\}|j
|�}|d	kr�t	j||�}|rt
|t|jd���Vqq�q�WdS(
uEFind rel="homepage" and rel="download" links in `page`, yielding URLsu,uhomepageudownloadiu
<th>Home Pageu<th>Download URLN(u
<th>Home Pageu<th>Download URLi����(uRELufinditerugroupsusetumapustrustripulowerusplituHREFuurljoinu
htmldecodeugroupufindusearch(uurlupageumatchutagurelurelsupos((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyufind_external_links�s'(
ufind_external_linksuPython-urllib/%s setuptools/%siu
setuptoolscBs>|EeZdZdZdd�Zdd�Zdd�ZdS(	uContentCheckeruP
    A null content checker that defines the interface for checking content
    cCsdS(u3
        Feed a block of data to the hash.
        N((uselfublock((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyufeed�suContentChecker.feedcCsdS(uC
        Check the hash. Return False if validation fails.
        T(uTrue(uself((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyuis_valid�suContentChecker.is_validcCsdS(uu
        Call reporter with information about the checker (hash name)
        substituted into the template.
        N((uselfureporterutemplate((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyureport�suContentChecker.reportN(u__name__u
__module__u__qualname__u__doc__ufeeduis_validureport(u
__locals__((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyuContentChecker�suContentCheckercBse|EeZdZejd�Zdd�Zedd��Zdd�Z	dd	�Z
d
d�ZdS(
uHashCheckeruK(?P<hash_name>sha1|sha224|sha384|sha256|sha512|md5)=(?P<expected>[a-f0-9]+)cCs(||_tj|�|_||_dS(N(u	hash_nameuhashlibunewuhashuexpected(uselfu	hash_nameuexpected((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu__init__�s	uHashChecker.__init__cCsLt|�d}|st�S|jj|�}|s<t�S||j��S(u5Construct a (possibly null) ContentChecker from a URLii����(uurlparseuContentCheckerupatternusearchu	groupdict(uclsuurlufragmentumatch((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyufrom_url�suHashChecker.from_urlcCs|jj|�dS(N(uhashuupdate(uselfublock((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyufeed�suHashChecker.feedcCs|jj�|jkS(N(uhashu	hexdigestuexpected(uself((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyuis_valid�suHashChecker.is_validcCs||j}||�S(N(u	hash_name(uselfureporterutemplateumsg((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyureports
uHashChecker.reportN(u__name__u
__module__u__qualname__ureucompileupatternu__init__uclassmethodufrom_urlufeeduis_validureport(u
__locals__((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyuHashChecker�s	uHashCheckercs�|EeZdZdZddGdHdIdd�ZdJdd�ZdJdd	�Z	dJd
d�Z
dd
�Zdd�Zdd�Z
dd�ZdHdd�Zdd�ZdH�fdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�ZdJdJdJdHd$d%�ZdJdJd&d'�Zd(d)�Zd*Zd+d,�Zd-d.�ZdHd/d0�Zd1d2�Zd3d4�Zd5d6�Z d7d8�Z!d9d:�Z"e#dJd;d<��Z$d=d>�Z%d?d@�Z&dAdB�Z'dCdD�Z(dEdF�Z)�S(KuPackageIndexu;A distribution index that scans web pages for download URLsuhttps://pypi.python.org/simpleu*cOs�tj|||�|dd|jd��|_i|_i|_i|_tjdj	t
t|���j|_
g|_|r�tjr�|s�tj�r�tj|�|_ntj|_dS(Nu/u|(uEnvironmentu__init__uendswithu	index_urluscanned_urlsufetched_urlsu
package_pagesureucompileujoinumapu	translateumatchuallowsuto_scanussl_supportuis_availableufind_ca_bundleu
opener_foruopeneruurllib2uurlopen(uselfu	index_urluhostsu	ca_bundleu
verify_ssluargsukw((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu__init__	s!			'	!uPackageIndex.__init__c

CsU||jkr|rdSd|j|<t|�sD|j|�dStt|��}|r�|j|�sodS|jd|�n|s�|s�||jkr�tt	|j
|��dS|j|�s�d|j|<dS|jd|�d|j|<|j|d|�}|dkrdSd|j|j<d|jjdd�j�krZ|j�dS|j}|j�}t|t�s�t|t�r�d}n|jjd	�p�d}|j|d
�}n|j�xBtj|�D]1}t|t|jd���}	|j|	�q�W|j|j �rQt!|dd�d
krQ|j"||�}ndS(u<Evaluate a URL as a possible download, and maybe retrieve itNuFound link: %su
Reading %su<Download error on %s: %%s -- Some packages may not be found!uhtmlucontent-typeuulatin-1ucharsetuignoreiucodei�T(#uscanned_urlsuTrueu
URL_SCHEMEuprocess_filenameulistudistros_for_urluurl_okudebugufetched_urlsumapuadduinfouopen_urluNoneuurluheadersugetulowerucloseureadu
isinstanceustru	HTTPErroru	get_paramudecodeuHREFufinditeruurljoinu
htmldecodeugroupuprocess_urlu
startswithu	index_urlugetattru
process_index(
uselfuurluretrieveudistsufubaseupageucharsetumatchulink((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyuprocess_urlsN



!
		
*uPackageIndex.process_urlcCs�tjj|�s&|jd|�dStjj|�r�|r�tjj|�}x9tj|�D]%}|jtjj||�d�qaWnt
|�}|r�|jd|�tt
|j|��ndS(Nu
Not found: %su	Found: %sT(uosupathuexistsuwarnuisdirurealpathulistdiruprocess_filenameujoinuTrueudistros_for_filenameudebugulistumapuadd(uselfufnunestedupathuitemudists((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyuprocess_filenameHs&uPackageIndex.process_filenamecCs}t|�}|r-|jd�j�dksF|jt|�d�rJdSd}|rit||��n|j||�dS(NiufileuN
Note: Bypassing %s (disallowed host; see http://bit.ly/1dg9ijs for details).
T(u
URL_SCHEMEugroupuloweruallowsuurlparseuTrueuDistutilsErroruwarn(uselfuurlufatalusumsg((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyuurl_okXs:uPackageIndex.url_okcCsfx_|D]W}tjj|�rx<tj|�D](}|jd�r/|j||�q/q/WqqWdS(Nu	.egg-link(uosupathuisdirulistdiruendswithu
scan_egg_link(uselfusearch_pathuitemuentry((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyuscan_egg_linkscs

uPackageIndex.scan_egg_linkscCs�dd�ttjttjj||���D�}t|�dkr�xXttjj||d��D]4}tjj||�|_	t
|_|j|�qfWndS(NcSsg|]}|r|�qS(((u.0u_f((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu
<listcomp>ks	u.PackageIndex.scan_egg_link.<locals>.<listcomp>ii(
umapustrustripuopenuosupathujoinulenufind_distributionsulocationuSOURCE_DISTu
precedenceuadd(uselfupathuentryulinesudist((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu
scan_egg_linkjs"&	uPackageIndex.scan_egg_linkc

s�fdd�}xRtj|�D]A}y&|t|t|jd����Wq"tk
rbYq"Xq"W||�\}}|rxyt||�D]h}t|�\}}	|jd�r�|	r�|r�|d||f7}q��j	|�n�j
|�q�Wtjdd�|�SdSd	S(
u#Process the contents of a PyPI pagecs�|j�j�r�ttt|t�j�d�jd���}t|�dkr�d|dkr�t|d�}t|d�}d�j
j|j�i�|<t
|�t
|�fSndS(Nu/iu#iiT(NN(u
startswithu	index_urlulistumapuunquoteulenusplitu	safe_nameusafe_versionuTrueu
package_pagesu
setdefaultuloweruto_filenameuNone(ulinkupartsupkguver(uself(u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyuscanus+"u(PackageIndex.process_index.<locals>.scaniu.pyu
#egg=%s-%scSsd|jddd�S(Nu<a href="%s#md5=%s">%s</a>iii(ugroup(um((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu<lambda>�su,PackageIndex.process_index.<locals>.<lambda>uN(
uHREFufinditeruurljoinu
htmldecodeugroupu
ValueErrorufind_external_linksuegg_info_for_urluendswithuneed_version_infouscan_urluPYPI_MD5usub(
uselfuurlupageuscanumatchupkguverunew_urlubaseufrag((uselfu1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu
process_indexss$&
	uPackageIndex.process_indexcCs|jd|�dS(NuPPage at %s links to .py file(s) without version info; an index scan is required.(uscan_all(uselfuurl((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyuneed_version_info�suPackageIndex.need_version_infocGsO|j|jkr;|r+|j||�n|jd�n|j|j�dS(Nu6Scanning index of all packages (this may take a while)(u	index_urlufetched_urlsuwarnuinfouscan_url(uselfumsguargs((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyuscan_all�s
uPackageIndex.scan_allcCs�|j|j|jd�|jj|j�sN|j|j|jd�n|jj|j�ss|j|�nx3t|jj|jf��D]}|j|�q�WdS(Nu/(	uscan_urlu	index_urluunsafe_nameu
package_pagesugetukeyuproject_nameunot_found_in_indexulist(uselfurequirementuurl((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu
find_packages�s%uPackageIndex.find_packagescsk|j�|j|�x8||jD])}||kr;|S|jd||�q%Wtt|�j||�S(Nu%s does not match %s(uprescanu
find_packagesukeyudebugusuperuPackageIndexuobtain(uselfurequirementu	installerudist(u	__class__(u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyuobtain�s

uPackageIndex.obtaincCsi|j|jd|�|j�se|j�tj|�td|jjtj	j
|�f��ndS(u-
        checker is a ContentChecker
        uValidating %%s checksum for %su7%s validation failed for %s; possible download problem?N(ureportudebuguis_validucloseuosuunlinkuDistutilsErroruhashunameupathubasename(uselfucheckerufilenameutfp((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu
check_hash�s

uPackageIndex.check_hashcCsrxk|D]c}|jdksJt|�sJ|jd�sJtt|��rZ|j|�q|jj|�qWdS(u;Add `urls` to the list that will be prescanned for searchesufile:N(uto_scanuNoneu
URL_SCHEMEu
startswithulistudistros_for_urluscan_urluappend(uselfuurlsuurl((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyuadd_find_links�s

uPackageIndex.add_find_linkscCs2|jr%tt|j|j��nd|_dS(u7Scan urls scheduled for prescanning (e.g. --find-links)N(uto_scanulistumapuscan_urluNone(uself((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyuprescan�s	uPackageIndex.prescancCsN||jr |jd}}n|jd}}|||j�|j�dS(Nu#Couldn't retrieve index page for %ru3Couldn't find index page for %r (maybe misspelled?)(ukeyuinfouwarnuunsafe_nameuscan_all(uselfurequirementumethumsg((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyunot_found_in_index�s

uPackageIndex.not_found_in_indexcCs�t|t�s�t|�}|r||j|jd�||�}t|�\}}|jd�rx|j|||�}n|Stj	j
|�r�|Sytj|�}Wq�tk
r�t
d|f��Yq�Xnt|j||�dd�S(uLocate 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.
        iu.pyu1Not a URL, existing file, or requirement spec: %rulocationN(u
isinstanceuRequirementu
URL_SCHEMEu
_download_urlugroupuegg_info_for_urluendswithu	gen_setupuosupathuexistsuparseu
ValueErroruDistutilsErrorugetattrufetch_distributionuNone(uselfuspecutmpdiruschemeufoundubaseufragment((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyudownload�s"
uPackageIndex.downloadc		sN�jd|�i�d	}d	����fdd�}|rf�j��j|�||�}n|d	k	r�|p�|||�}n|d	kr��jd	k	r��j�||�}n|d	kr�|r��j|�||�}n|d	kr�jd�rdpd|�n/�jd|�|jd�j|j|��Sd	S(
u|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.
        uSearching for %scs�|dkr�}nx�||jD]q}|jtkrn�rn|�kr#�jd|�d�|<q#q#n||kr#|jtks��r#|Sq#WdS(Nu&Skipping development or system egg: %si(uNoneukeyu
precedenceuDEVELOP_DISTuwarnuSOURCE_DIST(urequenvudist(u
develop_okuselfuskippedusource(u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyufind1s	
"u-PackageIndex.fetch_distribution.<locals>.findu2No local packages or download links found for %s%sua source distribution of uuBest match: %sulocationN(	uinfouNoneuprescanu
find_packagesuto_scanuwarnucloneudownloadulocation(	uselfurequirementutmpdiru
force_scanusourceu
develop_okulocal_indexudistufind((u
develop_okuselfuskippedusourceu1/tmp/pip-k8wh6o-build/setuptools/package_index.pyufetch_distributions.




uPackageIndex.fetch_distributioncCs/|j||||�}|dk	r+|jSdS(u3Obtain 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(ufetch_distributionuNoneulocation(uselfurequirementutmpdiru
force_scanusourceudist((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyufetch[suPackageIndex.fetchc
Csbtj|�}|r=dd�t||jd�d�D�p@g}t|�dkr3tjj|�}tjj	|�|kr�tjj
||�}ddlm}|||�s�t
j||�|}q�nttjj
|d�d�}	|	jd|dj|djtjj|�df�|	j�|S|rRtd	||f��ntd
��dS(NcSsg|]}|jr|�qS((uversion(u.0ud((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu
<listcomp>ks	u*PackageIndex.gen_setup.<locals>.<listcomp>ii(usamefileusetup.pyuwuIfrom setuptools import setup
setup(name=%r, version=%r, py_modules=[%r])
u�Can't unambiguously interpret project/version identifier %r; any dashes in the name or version should be escaped using underscores. %rupCan't process plain .py files without an '#egg=name-version' suffix to enable automatic setup script generation.(uEGG_FRAGMENTumatchuinterpret_distro_nameugroupuNoneulenuosupathubasenameudirnameujoinusetuptools.command.easy_installusamefileushutilucopy2uopenuwriteuproject_nameuversionusplitextucloseuDistutilsError(
uselfufilenameufragmentutmpdirumatchudistsubasenameudstusamefileufile((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu	gen_setuphs4	
uPackageIndex.gen_setupi c
Cs�|jd|�d\}}}zHtj|�}|jt|��}t|t�rwtd||j	|j
f��n|j�}d}|j}	d	}
d|kr�t|d�}t
tt|��}
|j||||	|
�nt|d�}xY|j|	�}|rK|j|�|j|�|d7}|j||||	|
�q�Pq�|j|||�|SWd|r}|j�n|r�|j�nXdS(
NuDownloading %suCan't download %s: %s %siiucontent-lengthuContent-Lengthuwb(NNNi����(uinfouNoneuHashCheckerufrom_urluopen_urlustrip_fragmentu
isinstanceu	HTTPErroruDistutilsErrorucodeumsgudl_blocksizeuget_all_headersumaxumapuintu
reporthookuopenureadufeeduwriteu
check_hashuclose(
uselfuurlufilenameufputfpuinfoucheckeruheadersublocknumubsusizeusizesublock((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu_download_to�s>	



uPackageIndex._download_tocCsdS(N((uselfuurlufilenameublocknumublksizeusize((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu
reporthook�suPackageIndex.reporthookcCs�|jd�rt|�Syt||j�SWn�ttjfk
r�tj�d}dj	dd�|j
D��}|r�|j||�ntd||f��Yn.t
jk
r�tj�d}|SYnt
jk
r)tj�d}|r|j||j�ntd||jf��Yn�tjk
r�tj�d}|re|j||j�ntd||jf��YnTtjk
r�tj�d}|r�|j||�ntd||f��YnXdS(	Nufile:iu cSsg|]}t|��qS((ustr(u.0uarg((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu
<listcomp>�s	u)PackageIndex.open_url.<locals>.<listcomp>u%s %suDownload error for %s: %su;%s returned a bad status line. The server might be down, %s(u
startswithu
local_openuopen_with_authuopeneru
ValueErroruhttplibu
InvalidURLusysuexc_infoujoinuargsuwarnuDistutilsErroruurllib2u	HTTPErroruURLErrorureasonu
BadStatusLineulineu
HTTPException(uselfuurluwarninguvumsg((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyuopen_url�s@
uPackageIndex.open_urlcCsBt|�\}}|rLx7d|krH|jdd�jdd�}qWnd}|jd�rt|dd�}ntjj||�}|dks�|jd	�r�|j||�S|d
ks�|jd�r�|j||�S|jd�r�|j	||�S|d
krt
t|�d�S|j|d�|j||�SdS(Nu..u.u\u_u__downloaded__u.egg.zipiusvnusvn+ugitugit+uhg+ufileii����T(uegg_info_for_urlureplaceuendswithuosupathujoinu
startswithu
_download_svnu
_download_gitu_download_hguurl2pathnameuurlparseuurl_okuTrueu_attempt_download(uselfuschemeuurlutmpdirunameufragmentufilename((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu
_download_url�s$%uPackageIndex._download_urlcCs|j|d�dS(NT(uprocess_urluTrue(uselfuurl((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyuscan_url�suPackageIndex.scan_urlcCsK|j||�}d|jdd�j�krC|j|||�S|SdS(Nuhtmlucontent-typeu(u_download_tougetuloweru_download_html(uselfuurlufilenameuheaders((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu_attempt_downloadsuPackageIndex._attempt_downloadcCs�t|�}xW|D]O}|j�rtjd|�r^|j�tj|�|j||�SPqqW|j�tj|�td|��dS(Nu <title>([^- ]+ - )?Revision \d+:uUnexpected HTML page found at (	uopenustripureusearchucloseuosuunlinku
_download_svnuDistutilsError(uselfuurluheadersufilenameufileuline((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu_download_html	s




uPackageIndex._download_htmlc
Cs`|jdd�d}d}|j�jd�r/d|kr/t|�\}}}}}}	|r/|jd�r/d|d	d�kr/|d	d�jdd�\}}t|�\}
}|
r,d
|
kr�|
jd
d�\}}
d||
f}n
d|
}|}t||||||	f�}q,q/n|jd
||�tjd|||f�|S(Nu#iiuusvn:u@u//u/iu:u --username=%s --password=%su --username=u'Doing subversion checkout from %s to %susvn checkout%s -q %s %s(	usplituloweru
startswithuurlparseu	splituseru
urlunparseuinfouosusystem(uselfuurlufilenameucredsuschemeunetlocupathupuqufuauthuhostuuserupw((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu
_download_svns"!,"
'uPackageIndex._download_svncCs�t|�\}}}}}|jdd�d}|jdd�d}d}d|krt|jdd�\}}nt||||df�}||fS(Nu+iu#iu@ui����(uurlsplitusplituNoneursplitu
urlunsplit(uurlu
pop_prefixuschemeunetlocupathuqueryufragurev((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu_vcs_split_rev_from_url,su$PackageIndex._vcs_split_rev_from_urlcCs�|jdd�d}|j|dd	�\}}|jd||�tjd||f�|dk	r�|jd|�tjd||f�n|S(
Nu#iiu
pop_prefixuDoing git clone from %s to %sugit clone --quiet %s %suChecking out %su"(cd %s && git checkout --quiet %s)T(usplitu_vcs_split_rev_from_urluTrueuinfouosusystemuNone(uselfuurlufilenameurev((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu
_download_git>s	uPackageIndex._download_gitcCs�|jdd�d}|j|dd	�\}}|jd||�tjd||f�|dk	r�|jd|�tjd||f�n|S(
Nu#iiu
pop_prefixuDoing hg clone from %s to %suhg clone --quiet %s %suUpdating to %su(cd %s && hg up -C -r %s >&-)T(usplitu_vcs_split_rev_from_urluTrueuinfouosusystemuNone(uselfuurlufilenameurev((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu_download_hgNs	uPackageIndex._download_hgcGstj||�dS(N(ulogudebug(uselfumsguargs((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyudebug^suPackageIndex.debugcGstj||�dS(N(uloguinfo(uselfumsguargs((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyuinfoasuPackageIndex.infocGstj||�dS(N(uloguwarn(uselfumsguargs((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyuwarndsuPackageIndex.warn(u*NTF(*u__name__u
__module__u__qualname__u__doc__uNoneuTrueu__init__uFalseuprocess_urluprocess_filenameuurl_okuscan_egg_linksu
scan_egg_linku
process_indexuneed_version_infouscan_allu
find_packagesuobtainu
check_hashuadd_find_linksuprescanunot_found_in_indexudownloadufetch_distributionufetchu	gen_setupudl_blocksizeu_download_tou
reporthookuopen_urlu
_download_urluscan_urlu_attempt_downloadu_download_htmlu
_download_svnustaticmethodu_vcs_split_rev_from_urlu
_download_gitu_download_hgudebuguinfouwarn(u
__locals__((u	__class__u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyuPackageIndexsL
0	*		)A
*$(u!&(#(\d+|x[\da-fA-F]+)|[\w.:-]+);?cCs3t|t�s|S|dkr)t|�St|�S(Ni�(u
isinstanceuintuunichruchr(uc((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyuuchrks

uuchrcCs�|jd�}|jd�r:t|dd�d�}nC|jd�rbt|dd��}ntj||jd��}t|�S(Niu#xiiu#i(ugroupu
startswithuintuname2codepointugetuuchr(umatchuwhat((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu
decode_entityqsu
decode_entitycCs
tt|�S(u'Decode HTML entities in the given text.(u
entity_subu
decode_entity(utext((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu
htmldecode{su
htmldecodecs�fdd�}|S(Ncs��fdd�}|S(Ncs?tj�}tj��z�||�SWdtj|�XdS(N(usocketugetdefaulttimeoutusetdefaulttimeout(uargsukwargsuold_timeout(ufuncutimeout(u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu_socket_timeout�s

u@socket_timeout.<locals>._socket_timeout.<locals>._socket_timeout((ufuncu_socket_timeout(utimeout(ufuncu1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu_socket_timeout�su'socket_timeout.<locals>._socket_timeout((utimeoutu_socket_timeout((utimeoutu1/tmp/pip-k8wh6o-build/setuptools/package_index.pyusocket_timeouts	usocket_timeoutcCsCt|�}|j�}tj|�}|j�}|jdd�S(uq
    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
    u
u(uunquoteuencodeubase64uencodestringudecodeureplace(uauthuauth_su
auth_bytesu
encoded_bytesuencoded((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu_encode_auth�s
u_encode_authcBs>|EeZdZdZdd�Zdd�Zdd�ZdS(	u
Credentialu:
    A username/password pair. Use like a namedtuple.
    cCs||_||_dS(N(uusernameupassword(uselfuusernameupassword((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu__init__�s	uCredential.__init__ccs|jV|jVdS(N(uusernameupassword(uself((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu__iter__�suCredential.__iter__cCsdt|�S(Nu%(username)s:%(password)s(uvars(uself((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu__str__�suCredential.__str__N(u__name__u
__module__u__qualname__u__doc__u__init__u__iter__u__str__(u
__locals__((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu
Credential�su
CredentialcBsJ|EeZdZdd�Zedd��Zdd�Zdd�Zd	S(
u
PyPIConfigcCsutjdddgd�}tjj||�tjjtjjd�d�}tjj|�rq|j	|�ndS(u%
        Load from ~/.pypirc
        uusernameupasswordu
repositoryuu~u.pypircN(
udictufromkeysuConfigParseru__init__uosupathujoinu
expanduseruexistsuread(uselfudefaultsurc((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu__init__�s
!uPyPIConfig.__init__cs5�fdd��j�D�}tt�j|��S(Ncs.g|]$}�j|d�j�r|�qS(u
repository(ugetustrip(u.0usection(uself(u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu
<listcomp>�s	u2PyPIConfig.creds_by_repository.<locals>.<listcomp>(usectionsudictumapu_get_repo_cred(uselfusections_with_repositories((uselfu1/tmp/pip-k8wh6o-build/setuptools/package_index.pyucreds_by_repository�suPyPIConfig.creds_by_repositorycCsO|j|d�j�}|t|j|d�j�|j|d�j��fS(Nu
repositoryuusernameupassword(ugetustripu
Credential(uselfusectionurepo((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu_get_repo_cred�suPyPIConfig._get_repo_credcCs7x0|jj�D]\}}|j|�r|SqWdS(u�
        If the URL indicated appears to be a repository defined in this
        config, return the credential for that repository.
        N(ucreds_by_repositoryuitemsu
startswith(uselfuurlu
repositoryucred((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyufind_credential�suPyPIConfig.find_credentialN(u__name__u
__module__u__qualname__u__init__upropertyucreds_by_repositoryu_get_repo_credufind_credential(u
__locals__((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu
PyPIConfig�s	u
PyPIConfigcCs�t|�\}}}}}}|jd�r?tjd��n|d	kr`t|�\}}	nd
}|s�t�j|�}
|
r�t|
�}|
j	|f}t
jd|�q�n|rdt|�}t
||	||||f�}tj|�}
|
jd|�ntj|�}
|
jdt�||
�}|r�t|j�\}}}}}}||kr�||	kr�t
||||||f�|_q�n|S(u4Open a urllib2 request, handling HTTP authenticationu:unonnumeric port: ''uhttpuhttpsu*Authenticating as %s for %s (from .pypirc)uBasic u
Authorizationu
User-Agent(uhttpuhttpsN(uurlparseuendswithuhttplibu
InvalidURLu	splituseruNoneu
PyPIConfigufind_credentialustruusernameuloguinfou_encode_authu
urlunparseuurllib2uRequestu
add_headeru
user_agentuurl(uurluopeneruschemeunetlocupathuparamsuqueryufraguauthuhostucreduinfounew_urlurequestufpus2uh2upath2uparam2uquery2ufrag2((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyuopen_with_auth�s2!'uopen_with_authcCs|S(N((uurl((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu
fix_sf_urlsu
fix_sf_urlcCsut|�\}}}}}}t|�}tjj|�rItj|�S|jd�r=tjj|�r=g}x�tj	|�D]�}	|	dkr�t
tjj||	�d�}
|
j�}|
j
�Pn.tjjtjj||	��r�|	d7}	n|jd|	|	f�q�Wd|ddj|�}d\}}
nd\}}
}id
d6}t|||
|t|��S(u7Read a local path, with special support for directoriesu/u
index.htmluru<a href=%r>%s</a>u<html><head><title>%s</title>u</head><body>%s</body></html>u
i�uOKi�uPath not foundu	Not foundu	text/htmlucontent-type(i�uOK(i�uPath not foundu	Not found(uurlparseuurl2pathnameuosupathuisfileuurllib2uurlopenuendswithuisdirulistdiruopenujoinureaducloseuappendu	HTTPErroruStringIO(uurluschemeuserverupathuparamuqueryufragufilenameufilesufufpubodyustatusumessageuheaders((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu
local_opens*
!
!

u
local_open(^u__doc__usysuosureushutilusocketubase64uhashlibu	functoolsuwrapsu
pkg_resourcesu
CHECKOUT_DISTuDistributionuBINARY_DISTunormalize_pathuSOURCE_DISTurequireuEnvironmentufind_distributionsu	safe_nameusafe_versionuto_filenameuRequirementuDEVELOP_DISTu
setuptoolsussl_supportu	distutilsulogudistutils.errorsuDistutilsErrorusetuptools.compatuurllib2uhttplibuStringIOu	HTTPErroruurlparseu
urlunparseuunquoteu	splituseruurl2pathnameuname2codepointuunichruurljoinuurlsplitu
urlunsplituConfigParserufilterfalseufnmatchu	translateusetuptools.py26compatustrip_fragmentusetuptools.py27compatuget_all_headersucompileuEGG_FRAGMENTuIuHREFuPYPI_MD5umatchu
URL_SCHEMEusplitu
EXTENSIONSu__all__u_SOCKET_TIMEOUTuparse_bdist_wininstuegg_info_for_urluNoneudistros_for_urludistros_for_locationudistros_for_filenameuinterpret_distro_nameuunique_everseenu
unique_valuesuRELufind_external_linksuversionu
user_agentuobjectuContentCheckeruHashCheckeruPackageIndexusubu
entity_subuuchru
decode_entityu
htmldecodeusocket_timeoutu_encode_authu
Credentialu
PyPIConfiguurlopenuopen_with_authu
fix_sf_urlu
local_open(((u1/tmp/pip-k8wh6o-build/setuptools/package_index.pyu<module>spXd			"
'!��e
'+

?>