File "index.cpython-34.pyc"

Full Path: /home/attunedd/public_html/byp/izo/con7ext_sym404/rintoar.txt/opt/alt/python34/lib/python3.4/site-packages/pip/__pycache__/index.cpython-34.pyc
File size: 30.33 KB
MIME-type: text/x-bytecode.python
Charset: 8 bit


Reӝ@sdZddlZddlZddlZddlZddlZddlmZddlm	Z	m
Z
mZmZddl
mZmZmZmZmZddlmZmZddlmZmZmZddlmZmZdd	lmZmZm Z dd
l!m"Z"m#Z#m$Z$ddl%m&Z&dgZ'd
Z(idgd6Z)Gddde*Z+Gddde*Z,Gddde*Z-Gddde*Z.e.e	Z/ddZ0ddZ1dS)z!Routines related to PyPI, indexesN)logger)Infnormalize_namesplitext
is_prerelease)DistributionNotFoundBestVersionAlreadyInstalledInstallationErrorInvalidWheelFilenameUnsupportedWheel)urlparseurl2pathname)
PipSessionurl_to_pathpath_to_url)Wheel	wheel_ext)supported_tagssupported_tags_noarchget_platform)html5librequests
pkg_resources)SSLError
PackageFinderzlast.pypi.python.orghttpshttpc	@seZdZdZdggddddddZddZd	d
ZddZd
dZddZ	ddZ
ddZej
dZej
dejZej
dZddZddZddZddZd d!Zd"d#ZdS)$rzThis finds packages.

    This is meant to match easy_install's technique for looking for
    packages, by reading pages and looking for appropriate links
    TFNc

Cs||_||_g|_t|_t|_||_tdd|D|_tdd|D|_	|j|j	O_||_
d|_d|_||_
||_d|_|	pt|_dS)Ncss|]}t|VqdS)N)r).0nr$/tmp/pip-ztkk0jow-build/pip/index.py	<genexpr>4sz)PackageFinder.__init__.<locals>.<genexpr>css|]}t|VqdS)N)r)rrrrr r!8sF)
find_links
index_urlsdependency_links	PageCachecachesetlogged_links	use_wheelallow_externalallow_unverifiedallow_all_externalneed_warn_externalneed_warn_unverifiedallow_all_prereleasesprocess_dependency_links_have_warned_dependency_linksrsession)
selfr"r#r)r*r+r,r/r0r2rrr __init__&s"										zPackageFinder.__init__cCsE|jrA|js.tjddd|_n|jj|ndS)Nz1.6zpDependency Links processing has been deprecated with an accelerated time schedule and will be removed in pip 1.6T)r0r1r
deprecatedr$extend)r3linksrrr add_dependency_linksSs		z"PackageFinder.add_dependency_linksc	sJggfdd}x|D]}tjj|}|jd}||jk}|sj|r/|ry|}nt|}|rtjj|rtjj|}xztj|D]}|tjj	||qWq<|r
tjj|r
j
|q<tjj|r<||q<q(j
|q(WfS)zt
        Sort locations into "files" (archives) and "urls", and return
        a pair of lists (files,urls)
        csLt|}tj|ddddkr;j|n
j|dS)NstrictFrz	text/html)r	mimetypes
guess_typeappend)pathurl)filesurlsrr 	sort_pathksz0PackageFinder._sort_locations.<locals>.sort_pathzfile:)osr=exists
startswithr"risdirrealpathlistdirjoinr<isfile)	r3	locationsrAr>
is_local_pathis_file_urlis_find_linkr=itemr)r?r@r _sort_locationsbs*
	 zPackageFinder._sort_locationscCs|\}}}|jrtt}|tkr9d}nW|jtkrt|j}|jsyt	d|jn|j
}n|}||fS|SdS)aL
        Function used to generate link sort key for link tuples.
        The greater the return value, the more preferred it is.
        If not finding wheels, then sorted by version only.
        If finding wheels, then the sort order is by version, then:
          1. existing installs
          2. wheels ordered via Wheel.support_index_min()
          3. source archives
        Note: it was considered to embed this logic into the Link
              comparison operators, but then different sdist links
              with the same version, would have to be considered equal
        zB%s is not a supported wheel for this platform. It can't be sorted.N)r)lenrINSTALLED_VERSIONextrrfilename	supportedrsupport_index_min)r3
link_tupleparsed_versionlink_support_numpriwheelrrr _link_sort_keys
		
zPackageFinder._link_sort_keycCst|d|jddS)z
        Bring the latest version (and wheels) to the front, but maintain the existing ordering as secondary.
        See the docstring for `_link_sort_key` for details.
        This function is isolated for easier unit testing.
        keyreverseT)sortedr^)r3applicable_versionsrrr _sort_versionsszPackageFinder._sort_versionsc
sfdd|jd}|jrt|jddd}|j||}|dkr|jt|jddd|p|jqndk	rfdd|jD|j}nt|j}xH|jD]=}dk	r|dk	rtj	|j
|g|}qqW|j|\}}|j|j\}	}
|j
|	dd|D}|j
d	d|
Dtjd
|x|D]}tjd|tjt|}|jtkrt|j}
t|
dkr3||j|
d|jf}tjd
|qt|
dkrz||jdj	|
|jf}tjd|q||jf}tjd|qqWg}|j
|jdd|jD|jjg}xy|j||D]e}tjd|j
tjd7_z)|j
|j|j|jjWdtjd8_XqWt|jdd|jD|jj}|rtjddj	dd|Dnt|jdd|D|jj}|rj|rj|rj|rjtjd||jr7tjd|jn|j rWtjd|jnt!d|ng}|j"dk	r|j"j#t$|j"j%fg}n|r|j&ddtjddj	dd|Dn|||||}g}x|D]\}}}||j'kr]tjd||d j	d!d|j'j(DfqnKt)|r|j*px|j+r|t$k	rtjd"||fqqn|j,|||fqW|j-|}t.d#d|D}|rN|rN|ddt$kr%tjd$|j"j%n%tjd%|j"j%|ddfdS|stjd&|dj	d'd|Df|jrtjd(n|j rtjd|jnt!d)|n|ddt$kr-tjd*|j"j%dj	d+d|ddDpd,ft/nt|dkrwtjd-|dddj	d.d|Dfn|dd}|j0dk	r|j0rtjd/|jn|j1dk	r|j1rtjd0|jn|j2rtj3d1d2|jn|S)3Ncs2tj|}|jds.|d}n|S)N/)	posixpathrHendswith)r>loc)url_namerr mkurl_pypi_urls
z6PackageFinder.find_requirement.<locals>.mkurl_pypi_urlrtrustedTcsg|]}|qSrr)rr>)rirr 
<listcomp>s	z2PackageFinder.find_requirement.<locals>.<listcomp>cSs"g|]}t|ddqS)rjT)Link)rr>rrr rks	cSsg|]}t|qSr)rl)rr>rrr rks	z#URLs to search for versions for %s:z* %srPzS%s uses an insecure transport scheme (%s). Consider using %s if %s has it availablez, zc%s uses an insecure transport scheme (%s). Consider using one of %s if %s has any of them availablez*%s uses an insecure transport scheme (%s).cSs%g|]}t|dddqS)z-frjT)rl)rr>rrr rks	zAnalyzing links from page %scSsg|]}t|qSr)rl)rr>rrr rks	zdependency_links found: %scSs"g|]\}}}|jqSr)r>)rparsedrYversionrrr rks	cSsg|]}t|qSr)rl)rr>rrr rks	z<Could not find any downloads that satisfy the requirement %szMSome externally hosted files were ignored (use --allow-external %s to allow).zWSome insecure and unverifiable files were ignored (use --allow-unverified %s to allow).z$No distributions at all found for %sr`zLocal files found: %scSs(g|]\}}}t|jqSr)rr>)rrnrYrorrr rks	z-Ignoring link %s, version %s doesn't match %s,cSsg|]}dj|qS))rH)rsrrr rk"s	zCIgnoring link %s, version %s is a pre-release (use --pre to allow).cSs+g|]!\}}}|tkr|qSr)rR)rrXrYrorrr rk,s	zLExisting installed version (%s) is most up-to-date and satisfies requirementzUExisting installed version (%s) satisfies requirement (most up-to-date version is %s)zNCould not find a version that satisfies the requirement %s (from versions: %s)cSsg|]\}}}|qSrr)rrXrYrorrr rk7s	zJSome externally hosted files were ignored (use --allow-external to allow).z,No distributions matching the version for %sz=Installed version (%s) is most up-to-date (past versions: %s)cSsg|]\}}}|qSrr)rrXrYrorrr rkFs	nonez)Using version %s (newest of versions: %s)cSsg|]\}}}|qSrr)rrXrYrorrr rkJs	z2%s an externally hosted file and may be unreliablez,%s is potentially insecure and unverifiable.z1.7za%s discovered using a deprecated method of parsing, in the future it will no longer be discovered)4rhr#rl	_get_page_find_url_namer"listabsolute_versionsrerHr>rOr$r6rdebugrstrschemeINSECURE_SCHEMESrQnetlocwarn_package_versionsnamelower
_get_pagesindentr7infofatalr-r.rsatisfied_byrXrRrosortreqspecsrr/prereleasesr<rcboolrinternal
verifiable_deprecated_regexr5)r3rupgrademain_index_urlpagerJrofile_locations
url_locations_flocations_ulocationslocationrnsecure_schemesctxfound_versions
page_versionsdependency_versions
file_versionsinstalled_versionall_versionsrbrXrYexisting_applicableselected_versionr)rirhr find_requirements
		7#


			&)	(*	%				!*	-	
			$				:		/
	
		zPackageFinder.find_requirementcCs|jjds$|jd7_n|j||}|dkrWtjd|dSt|j}xY|jD]N}tj	|j
jd}|t|krptjd||f|SqpWdS)zFinds the true URL name of a package, when the given name isn't quite correct.
        This is usually used to implement case-insensitivity.rdNzCannot fetch index base URL %sz!Real name of requirement %s is %s)
r>rfrtrrrrhr7rebasenamer=rstripnotify)r3	index_urlrhrr	norm_namerYbaserrr rubszPackageFinder._find_url_namec	cs7t|}t}x|r2|jd}||kr?qn|j||j||}|dkrpqn|Vx|jD]}t|jj}||j	kr|j
rd|_tj
d|qn|jdk	r|jr||jkrtj
d|d|_qn|j|qWqWdS)z
        Yields (page, page_url) from the given locations, skipping
        locations that have errors, and adding download/homepage links
        rNTz@Not searching %s for files because external urls are disallowed.z_Not searching %s for urls, it is an untrusted link and cannot produce safe or verifiable files.)rvr'popaddrt	rel_linksrrrr*r,r-rrxrjr+r.r<)	r3rJr
all_locationsseenrrrY
normalizedrrr rus6		

		
		zPackageFinder._get_pagesz#egg=([^&]*)z([a-z0-9_.]+)-([a-z0-9_.-]+)z-py([123]\.?[0-9]?)$cCsqgg}}t}xP|D]H}||kr|j||jrU|j|qe|j|qqW||S)zgReturns elements of links in order, non-egg links first, egg links second, while eliminating duplicates)r'regg_fragmentr<)r3r7eggsno_eggsrrYrrr _sort_linkss
	

	zPackageFinder._sort_linksccs@x9|j|D](}x|j||D]}|Vq)WqWdS)N)r_link_package_versions)r3r7search_namerYvrrr r~szPackageFinder._package_versionscCsd}|jr|tfS|S)N.tar.gz.tar.bz2.tar.tgz.zip)rrrrr)r)r)r3
extensionsrrr _known_extensionss	zPackageFinder._known_extensionscCst}d}|jr$|j}nN|j\}}|ss||jkrotjd||jj|ngS|jdr|dd}d|}n||jkr||jkrtjd||f|jj|ngSd|j	kr@|dkr@||jkr<tjd||jj|ngS|t
krryt|j}Wn't
k
rtjd	|gSYnX|jj|jkrtjd
||fgS|jstjd|gSt|dd}|jd
rf|jdrf|dk	rftj|jjjdrf|jdtsftjd|gSn|j}n|s|j|||}n|dkrtjd
||fgS|jdk	r|jrt|j|jkr|jrtjd|d|_gS|jdk	re|jret|j|jkretjd|d|_ gS|j!j"|}	|	r|d|	j#}|	j$d}
|
t%jddkrtjd|gSntjd||ft&j'|||fgS)z
        Return an iterable of triples (pkg_resources_version_key,
        link, python_version) that can be extracted from the given
        link.

        Meant to be overridden by subclasses, not called by clients.
        NzSkipping link %s; not a filez.tarz,Skipping link %s; unknown archive format: %smacosx10z.zipzSkipping link %s; macosx10 onez1Skipping %s because the wheel filename is invalidz-Skipping link %s; wrong project name (not %s)z9Skipping %s because it is not compatible with this Python
comes_fromwinmacosxzpypi.python.orgtagszOSkipping %s because it is a pypi-hosted binary Wheel on an unsupported platformz,Skipping %s because it is externally hosted.Tz<Skipping %s because it is an insecure and unverifiable file.rPz/Skipping %s because Python version is incorrectzFound link %s, version: %s)(rrrr(rrxrrfrr=rrrTr
rrrUgetattrrDrr>r|rro_egg_info_matchesrrr*r,r-rr+r._py_version_researchstartgroupsysr
parse_version)r3rYrplatformroegg_inforSr]rmatch
py_versionrrr rs		

		

	
		z$PackageFinder._link_package_versionscCs|jj|}|s-tjd|dS|jdj}|jdd}|jd}|j|r|jdt|dSdSdS)Nz%Could not parse version from link: %srrZ-)	_egg_info_rerrrxrrreplacerDrQ)r3rrrYrrlook_forrrr r&szPackageFinder._egg_info_matchescCs"tj||d|jd|jS)Nr&r2)HTMLPageget_pager&r2)r3rYrrrr rt5s	zPackageFinder._get_page)__name__
__module____qualname____doc__r4r8rOr^rcrrurrecompile_egg_fragment_reIrrrr~rrrrtrrrr rs(	*()
lc@sseZdZdZdZddZddZddZd	d
Zddd
Z	ddZ
ddZdS)r%zCache of HTML pagesrcCsi|_i|_i|_dS)N)	_failures_pages	_archives)r3rrr r4As		zPageCache.__init__cCs|jj|d|jkS)Nr)rget
failure_limit)r3r>rrr too_many_failuresFszPageCache.too_many_failurescCs|jj|S)N)rr)r3r>rrr rIszPageCache.get_pagecCs|jj|dS)NF)rr)r3r>rrr 
is_archiveLszPageCache.is_archiveTcCs||j|<dS)N)r)r3r>valuerrr set_is_archiveOszPageCache.set_is_archivecCs$|jj|d||j|<dS)Nr)rr)r3r>levelrrr add_page_failureRszPageCache.add_page_failurecCs"x|D]}||j|<qWdS)N)r)r3r@rr>rrr add_pageUs
zPageCache.add_pageN)rrrrrr4rrrrrrrrrr r%<sr%c@sCeZdZdZejdejZejdejZejdejej	BZ
ddddZdd	Ze
dd
dddZedd
dddZedddZeddZeddZeddZddZd#ddZddZejd ejZd!d"ZdS)$rz'Represents one page, along with its URLz<th>\s*home\s*pagez<th>\s*download\s+urlz(href=(?:"([^"]*)"|'([^']*)'|([^>\s\n]*))NcCsC||_tj|jdd|_||_||_||_dS)NnamespaceHTMLElementsF)contentrparsernr>headersrj)r3rr>rrjrrr r4bs
			zHTMLPage.__init__cCs|jS)N)r>)r3rrr __str__iszHTMLPage.__str__TcCs\|dkrt}n|j}|jddd}|j|rJdSddlm}xT|jD]I}|jj|rd|t	|dkrdt
jdtdSqdW|dk	r|j
|}	|	dk	r|	Sny|r|dk	r
|j|r
dSn|j}
xddd	d
dgD]}}|
j|r)|j|d|}|jjd
rlPqt
jd||f|dk	r|j|ndSq)q)Wnt
jd|tj|\}}
}}}}|dkrEtjjt|rE|jds|d7}ntj|d}t
jd|n|j|did
d6}|j|jjdd}|jjd
st
jd||f|dk	r|j|ndS||j|j|jd|j}	Wn8tjk
r[}zE|j j!dkr!dnd}|j"||||d|d|WYdd}~Xntj#k
r}z%|j"||d||d|WYdd}~Xntj$k
r|j"||d|d|Ynt%k
r+}z:d|}|j"||||d|ddd t
j&WYdd}~Xn-X|dk	rT|j'||jg|	n|	SdS)!N#rPr)
VcsSupportz+:z&Cannot look at %(scheme)s URL %(link)sz.tarz.tar.gzz.tar.bz2z.tgzz.zipr2z	text/htmlz,Skipping page %s because of Content-Type: %szGetting page %sfilerdz
index.htmlz# file: URL is directory, getting %srAcceptzContent-Typeunknownrjirmr&rzconnection error: %sz	timed outz6There was a problem confirming the ssl certificate: %smeth)(rr>splitrpip.vcsrschemesrrDrQrrxlocalsrrrTrf_get_content_typerrrBr=rEr
urljoinrraise_for_statusrtextrjr	HTTPErrorresponsestatus_code_handle_failConnectionErrorTimeoutrrr)clsrYrr&
skip_archivesr2r>rrzinstrTbad_extcontent_typer|r=paramsqueryfragmentrespexcrreasonrrr rls	+		!$

		(4 zHTMLPage.get_pagerPcCsb|dkrtj}n|d|||d|j|f|dk	r^|j||ndS)NzCould not fetch URL %s: %sz7Will skip URL %s when looking for download links for %s)rrr>r)rrYrr>r&rrrrr rszHTMLPage._handle_failcCsx|dkrt}ntj|\}}}}}|d
krFdS|j|dd}|j|jjd	dS)z;Get the Content-Type of the given url, using a HEAD requestNrrftpftpsrqallow_redirectsTzContent-Type)zhttpzhttpszftpzftps)rrurlsplitheadrrr)r>r2rzr|r=rr	r
rrr rs
zHTMLPage._get_content_typecCst|dsd}dd|jjdD}|r~y t|djdd}Wq~ttfk
rzd}Yq~Xn||_n|jS)N_api_versioncSs4g|]*}|jddjdkr|qS)rrqzapi-version)rr)rxrrr rks	z(HTMLPage.api_version.<locals>.<listcomp>z.//metarr)hasattrrnfindallintr	TypeError
ValueErrorr)r3rmetasrrr api_versions zHTMLPage.api_versioncCsgt|ds`|jjd}|dk	rQ|jdrQ|jd|_q`|j|_n|jS)N	_base_urlz.//basehref)rrnfindrrr>)r3rrrr base_urlszHTMLPage.base_urlccsx|jjdD]}|jdr|jd}|jtj|j|}d}|jr|jdkrt|jdod|jdj	k}nt
||d|VqqWdS)zYields all links in the pagez.//arNrmrelr)rnrr
clean_linkrrrrrrrl)r3anchorrr>rrrr r7s!zHTMLPage.linksccs<x|jD]}|Vq
Wx|jD]}|Vq)WdS)N)explicit_rel_linksscraped_rel_links)r3r>rrr rs	zHTMLPage.rel_linkshomepagedownloadccst|}x|jjdD]}|jdr|jdrt|jdj}||@r|jd}|jtj|j|}t	||ddVqqqWdS)z)Yields all links with the given relationsz.//arrrjFN)
r'rnrrrr rrrrl)r3relsr!
found_relsrr>rrr r"s
zHTMLPage.explicit_rel_linksccsx|j|jfD]}|j|j}|s7qn|jj|jd|j}|sdqn|jdp|jdp|jd}|sqn|jtj	|j
|}t||ddddVqWdS)	NposrPrmrrjFrT)_homepage_re_download_rerr_href_reendrr rrrrl)r3regexr
href_matchr>rrr r#&s!-zHTMLPage.scraped_rel_linksz[^a-z0-9$&+,/:;=?@.#%_\\|-]cCs|jjdd|S)zMakes sure a link is fully encoded.  That is, if a ' ' shows up in
        the link, it will be rewritten to %20 (while not over-quoting
        % or other characters).cSsdt|jdS)Nz%%%2xr)ordr)rrrr <lambda><sz%HTMLPage.clean_link.<locals>.<lambda>)	_clean_resub)r3r>rrr r 7s	zHTMLPage.clean_link)zhomepagezdownload)rrrrrrrr)r*Sr+r4rclassmethodrstaticmethodrrpropertyrrr7rr"r#r1r rrrr rZs([
rc@sreZdZddddddZddZddZd	d
ZddZd
dZddZ	ddZ
ddZddZe
ddZe
ddZe
ddZddZe
dd Ze
d!d"Zejd#Ze
d$d%Zejd&Ze
d'd(Ze
d)d*Ze
d+d,Ze
d-d.ZdS)/rlNFcCs1||_||_||_||_||_dS)N)r>rrrjr)r3r>rrrjrrrr r4As
				z
Link.__init__cCs.|jrd|j|jfSt|jSdS)Nz%s (from %s))rr>ry)r3rrr rIs	zLink.__str__cCsd|S)Nz	<Link %s>r)r3rrr __repr__Osz
Link.__repr__cCs|j|jkS)N)r>)r3otherrrr __eq__RszLink.__eq__cCs|j|jkS)N)r>)r3r8rrr __ne__UszLink.__ne__cCs|j|jkS)N)r>)r3r8rrr __lt__XszLink.__lt__cCs|j|jkS)N)r>)r3r8rrr __le__[szLink.__le__cCs|j|jkS)N)r>)r3r8rrr __gt__^szLink.__gt__cCs|j|jkS)N)r>)r3r8rrr __ge__aszLink.__ge__cCs
t|jS)N)hashr>)r3rrr __hash__dsz
Link.__hash__cCs\tj|j\}}}}}tj|jdp<|}|sXtd|j|S)NrdzURL %r produced no filename)rrr>rerrAssertionError)r3rZr|r=rrrr rTgs!z
Link.filenamecCstj|jdS)Nr)rrr>)r3rrr rznszLink.schemecCstj|jdS)Nrm)rrr>)r3rrr r=rsz	Link.pathcCsttj|jjdS)Nrd)rrerr=r)r3rrr rvsz
Link.splitextcCs|jdS)NrP)r)r3rrr rSyszLink.extcCs=tj|j\}}}}}tj||||dfS)N)rrr>
urlunsplit)r3rzr|r=rr	rrr url_without_fragment}s!zLink.url_without_fragmentz#egg=([^&]*)cCs,|jj|j}|sdS|jdS)NrP)rrr>r)r3rrrr rszLink.egg_fragmentz2(sha1|sha224|sha384|sha256|sha512|md5)=([a-f0-9]+)cCs,|jj|j}|r(|jdSdS)Nrm)_hash_rerr>r)r3rrrr r?s
z	Link.hashcCs,|jj|j}|r(|jdSdS)NrP)rDrr>r)r3rrrr 	hash_names
zLink.hash_namecCs0tj|jjdddjdddS)NrrPr?)rerr>r)r3rrr show_urlsz
Link.show_urlcCs|jpt|jdd}|dk	r|ry%t|jdd}t|}Wnttfk
rud}YnX|dks|dkrdS|jrdSdSn|dk	rdSdS)z
        Returns True if this link can be verified after download, False if it
        cannot, and None if we cannot determine.
        rjNrrPTF)rjrrrrrr?)r3rjrrrr rs	zLink.verifiable)rrrr4rr7r9r:r;r<r=r>r@r6rTrzr=rrSrCrrrrrDr?rErGrrrrr rl?s0	rlcCs;t|}|j}|s1t|jd}nt|S)zPGet a requirement from the URL, if possible.  This looks for #egg
    in the URLr)rlrrrTpackage_to_requirement)r>rYrrrr get_requirement_from_urls
	rIcCsatjd|}|r9|jd}|jd}n|}d}|rYd||fS|SdS)z)Translate a name like Foo-1.2 to Foo==1.3z^(.*?)-(dev|\d.*)rPrmrqz%s==%sN)rrr)package_namerrrorrr rHsrH)2rrrBrr:repip.logrpip.utilrrrrpip.exceptionsrrr	r
rZpip.backwardcompatrr
pip.downloadrrr	pip.wheelrrZpip.pep425tagsrrrpip._vendorrrrZpip._vendor.requests.exceptionsr__all__DEFAULT_MIRROR_HOSTNAMEr{objectrr%rrlrRrIrHrrrr <module>s6"(