AlkantarClanX12

Your IP : 52.15.68.97


Current Path : /opt/alt/python34/lib/python3.4/site-packages/pip/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib/python3.4/site-packages/pip/__pycache__/index.cpython-34.pyc

�
�Reӝ�@s�dZddlZddlZddlZddlZddlZddlmZddlm	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+Gdd�de*�Z,Gdd�de*�Z-Gdd�de*�Z.e.e	�Z/dd�Z0dd�Z1dS)z!Routines related to PyPI, indexes�N)�logger)�Inf�normalize_name�splitext�
is_prerelease)�DistributionNotFound�BestVersionAlreadyInstalled�InstallationError�InvalidWheelFilename�UnsupportedWheel)�urlparse�url2pathname)�
PipSession�url_to_path�path_to_url)�Wheel�	wheel_ext)�supported_tags�supported_tags_noarch�get_platform)�html5lib�requests�
pkg_resources)�SSLError�
PackageFinderzlast.pypi.python.org�https�httpc	@seZdZdZdggdddddd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zej
d�Zej
dej�Zej
d�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�ZdS)$rz�This 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|_|	p�t�|_dS)Ncss|]}t|�VqdS)N)r)�.0�n�r�$/tmp/pip-ztkk0jow-build/pip/index.py�	<genexpr>4sz)PackageFinder.__init__.<locals>.<genexpr>css|]}t|�VqdS)N)r)rrrrr r!8sF)�
find_links�
index_urls�dependency_links�	PageCache�cache�set�logged_links�	use_wheel�allow_external�allow_unverified�allow_all_external�need_warn_external�need_warn_unverified�allow_all_prereleases�process_dependency_links�_have_warned_dependency_linksr�session)
�selfr"r#r)r*r+r,r/r0r2rrr �__init__&s"										zPackageFinder.__init__cCsE|jrA|js.tjdd�d|_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)r3�linksrrr �add_dependency_linksSs		z"PackageFinder.add_dependency_linksc	sJg�g���fdd�}x|D]}tjj|�}|jd�}||jk}|sj|r/|ry|}nt|�}|r�tjj|�r�tjj|�}xztj|�D]}|tjj	||��q�Wq<|r
tjj|�r
�j
|�q<tjj|�r<||�q<q(�j
|�q(W��fS)zt
        Sort locations into "files" (archives) and "urls", and return
        a pair of lists (files,urls)
        csLt|�}tj|dd�ddkr;�j|�n
�j|�dS)N�strictFrz	text/html)r�	mimetypes�
guess_type�append)�path�url)�files�urlsrr �	sort_pathksz0PackageFinder._sort_locations.<locals>.sort_pathzfile:)�osr=�exists�
startswithr"r�isdir�realpath�listdir�joinr<�isfile)	r3�	locationsrAr>�
is_local_path�is_file_url�is_find_linkr=�itemr)r?r@r �_sort_locationsbs*
	 zPackageFinder._sort_locationscCs�|\}}}|jr�tt�}|tkr9d}nW|jtkr�t|j�}|j�syt	d|j��n|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)�lenr�INSTALLED_VERSION�extrr�filename�	supportedr�support_index_min)r3�
link_tuple�parsed_version�link�_�support_num�pri�wheelrrr �_link_sort_key�s
		
zPackageFinder._link_sort_keycCst|d|jdd�S)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.
        �key�reverseT)�sortedr^)r3�applicable_versionsrrr �_sort_versions�szPackageFinder._sort_versionsc
s�fdd��|j�d}|jr�t�|jd�dd�}|j||�}|dkr�|jt|jddd��|�p�|j�q�n�dk	r��fdd�|jD�|j}nt|j�}xH|jD]=}�dk	r�|dk	r�tj	|j
|�g|}q�q�W|j|�\}}|j|j�\}	}
|j
|	�dd�|D�}|j
d	d�|
D��tjd
|�x�|D]�}tjd|�tjt|��}|jtkr�t|j}
t|
�dkr3||j|
d|jf}tjd
|�q�t|
�dkrz||jdj	|
�|jf}tjd|�q�||jf}tjd|�q�q�Wg}|j
|jdd�|jD�|jj���g}xy|j||�D]e}tjd|j
�tjd7_z)|j
|j|j|jj���Wdtjd8_Xq�Wt|jdd�|jD�|jj���}|r�tjddj	dd�|D���nt|jdd�|D�|jj���}|rj|rj|rj|rjtjd|�|jr7tjd|j�n|j rWtjd|j�nt!d|��ng}|j"dk	r�|j"j#t$|j"j%fg}n|r�|j&dd�tjddj	dd�|D���n|||||}g}x�|D]�\}}}||j'kr]tjd||d j	d!d�|j'j(D��f�qnKt)|�r�|j*px|j+r�|t$k	r�tjd"||f�qq�n|j,|||f�qW|j-|�}t.d#d�|D��}|rN|rN|ddt$kr%tjd$|j"j%�n%tjd%|j"j%|ddf�dS|s�tjd&|dj	d'd�|D��f�|jr�tjd(�n|j r�tjd|j�nt!d)|��n|ddt$kr-tjd*|j"j%dj	d+d�|dd�D��pd,f�t/�nt|�dkrwtjd-|dddj	d.d�|D��f�n|dd}|j0dk	r�|j0r�tjd/|j�n|j1dk	r�|j1r�tjd0|j�n|j2rtj3d1d2|j�n|S)3Ncs2tj|��}|jd�s.|d}n|S)N�/)�	posixpathrH�endswith)r>�loc)�url_namerr �mkurl_pypi_url�s
z6PackageFinder.find_requirement.<locals>.mkurl_pypi_urlr�trustedTcsg|]}�|��qSrr)rr>)rirr �
<listcomp>�s	z2PackageFinder.find_requirement.<locals>.<listcomp>cSs"g|]}t|dd��qS)rjT)�Link)rr>rrr rk�s	cSsg|]}t|��qSr)rl)rr>rrr rk�s	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|ddd��qS)z-frjT)rl)rr>rrr rk�s	zAnalyzing links from page %s�cSsg|]}t|��qSr)rl)rr>rrr rks	zdependency_links found: %scSs"g|]\}}}|j�qSr)r>)r�parsedrY�versionrrr 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|j��qSr)rr>)rrnrYrorrr rks	z-Ignoring link %s, version %s doesn't match %s�,cSsg|]}dj|��qS)�)rH)r�srrr 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"�list�absolute_versionsrerHr>rOr$r6r�debugr�str�scheme�INSECURE_SCHEMESrQ�netloc�warn�_package_versions�name�lower�
_get_pages�indentr7�info�fatalr-r.r�satisfied_byrXrRro�sort�req�specsrr/�prereleasesr<rc�boolr�internal�
verifiable�_deprecated_regexr5)r3r��upgrade�main_index_url�pagerJro�file_locations�
url_locations�_flocations�_ulocations�locationrn�secure_schemes�ctx�found_versions�
page_versions�dependency_versions�
file_versions�installed_version�all_versionsrbrXrY�existing_applicable�selected_versionr)rirhr �find_requirement�s�
		7#


			&)	(*	%				!*	-	
			$				:		/
	
		zPackageFinder.find_requirementcCs�|jjd�s$|jd7_n|j||�}|dkrWtjd|�dSt|j�}xY|jD]N}tj	|j
jd��}|t|�krptjd||f�|SqpWdS)z�Finds 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>rfrtrr�rrhr7re�basenamer=�rstrip�notify)r3�	index_urlrhr�r��	norm_namerY�baserrr rubszPackageFinder._find_url_namec	cs7t|�}t�}x|r2|jd�}||kr?qn|j|�|j||�}|dkrpqn|Vx�|j�D]�}t|j�j�}||j	kr�|j
r�d|_tj
d|�q�n|jdk	r|jr||jkrtj
d|�d|_q�n|j|�q�WqWdS)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'�pop�addrt�	rel_linksrrr�r*r,r-rrxrjr+r.r<)	r3rJr��
all_locations�seenr�r�rY�
normalizedrrr r�us6		

		
		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<)r3r7�eggs�no_eggsr�rYrrr �_sort_links�s
	

	zPackageFinder._sort_linksccs@x9|j|�D](}x|j||�D]}|Vq)WqWdS)N)r��_link_package_versions)r3r7�search_namerY�vrrr r~�szPackageFinder._package_versionscCsd}|jr|tfS|S)N�.tar.gz�.tar.bz2�.tar�.tgz�.zip)r�r�r�r�r�)r)r)r3�
extensionsrrr �_known_extensions�s	zPackageFinder._known_extensionscCst�}d}|jr$|j}nN|j�\}}|ss||jkrotjd|�|jj|�ngS|jd�r�|dd�}d|}n||j�kr�||jkr�tjd||f�|jj|�ngSd|j	kr@|dkr@||jkr<tjd|�|jj|�ngS|t
krryt|j�}Wn't
k
r�tjd	|�gSYnX|jj�|j�kr�tjd
||f�gS|j�s�tjd|�gSt|dd�}|jd
�rf|jd�rf|dk	rftj|j�jjd�rf|jdt�sftjd|�gSn|j}n|s�|j|||�}n|dkr�tjd
||f�gS|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%jdd�kr�tjd|�gSntjd||f�t&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.tar�z,Skipping link %s; unknown archive format: %s�macosx10z.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_from�win�macosxzpypi.python.org�tagszOSkipping %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.rP�z/Skipping %s because Python version is incorrectzFound link %s, version: %s���)(rr�rr(rrxr�rfr�r=rrrTr
rr�rU�getattrrDrr>r|rro�_egg_info_matchesr�rr*r,r-r�r+r.�_py_version_re�search�start�group�sysr�
parse_version)r3rYr��platformro�egg_inforSr]r��match�
py_versionrrr r��s�		

		

	
		z$PackageFinder._link_package_versionscCs�|jj|�}|s-tjd|�dS|jd�j�}|jdd�}|j�d}|j|�r�|jd�t|�d�SdSdS)Nz%Could not parse version from link: %srrZ�-)	�_egg_info_rer�rrxr�r��replacerDrQ)r3r�r�rYr�r�look_forrrr r�&szPackageFinder._egg_info_matchescCs"tj||d|jd|j�S)Nr&r2)�HTMLPage�get_pager&r2)r3rYr�rrr rt5s	zPackageFinder._get_page)�__name__�
__module__�__qualname__�__doc__r4r8rOr^rcr�rur��re�compile�_egg_fragment_re�Ir�r�r�r~r�r�r�rtrrrr rs(	*(�)
lc@sseZdZdZdZdd�Zdd�Zdd�Zd	d
�Zddd
�Z	dd�Z
dd�ZdS)r%zCache of HTML pagesr�cCsi|_i|_i|_dS)N)�	_failures�_pages�	_archives)r3rrr r4As		zPageCache.__init__cCs|jj|d�|jkS)Nr)r��get�
failure_limit)r3r>rrr �too_many_failuresFszPageCache.too_many_failurescCs|jj|�S)N)r�r�)r3r>rrr r�IszPageCache.get_pagecCs|jj|d�S)NF)r�r�)r3r>rrr �
is_archiveLszPageCache.is_archiveTcCs||j|<dS)N)r�)r3r>�valuerrr �set_is_archiveOszPageCache.set_is_archivecCs$|jj|d�||j|<dS)Nr)r�r�)r3r>�levelrrr �add_page_failureRszPageCache.add_page_failurecCs"x|D]}||j|<qWdS)N)r�)r3r@r�r>rrr �add_pageUs
zPageCache.add_pageN)r�r�r�r�r�r4r�r�r�r�r�r�rrrr r%<sr%c@sCeZdZdZejdej�Zejdej�Zejdejej	B�Z
dddd�Zdd	�Ze
dd
ddd��Zedd
ddd��Zeddd��Zedd��Zedd��Zedd��Zdd�Zd#dd�Zdd�Zejd ej�Zd!d"�ZdS)$r�z'Represents one page, along with its URLz<th>\s*home\s*pagez<th>\s*download\s+urlz(href=(?:"([^"]*)"|'([^']*)'|([^>\s\n]*))NcCsC||_tj|jdd�|_||_||_||_dS)N�namespaceHTMLElementsF)�contentr�parsernr>�headersrj)r3r�r>r�rjrrr r4bs
			zHTMLPage.__init__cCs|jS)N)r>)r3rrr �__str__iszHTMLPage.__str__TcCs\|dkrt�}n|j}|jdd�d}|j|�rJdSddlm}xT|jD]I}|j�j|�rd|t	|�dkrdt
jdt��dSqdW|dk	r�|j
|�}	|	dk	r�|	Sny|r�|dk	r
|j|�r
dSn|j}
x�ddd	d
dgD]}}|
j|�r)|j|d|�}|j�jd
�rlPq�t
jd||f�|dk	r�|j|�ndSq)q)Wnt
jd|�tj|�\}}
}}}}|dkrEtjjt|��rE|jd�s|d7}ntj|d�}t
jd|�n|j|did
d6�}|j�|jjdd�}|j�jd
�s�t
jd||f�|dk	r�|j|�ndS||j|j|jd|j�}	Wn8tjk
r[}zE|j j!dkr!dnd}|j"||||d|d|�WYdd}~Xn�tj#k
r�}z%|j"||d||d|�WYdd}~Xn�tj$k
r�|j"||d|d|�Yn�t%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 %s�filerdz
index.htmlz# file: URL is directory, getting %sr��AcceptzContent-Type�unknownrji�rmr&r�zconnection error: %sz	timed outz6There was a problem confirming the ssl certificate: %s�meth)(rr>�splitr��pip.vcsr��schemesr�rDrQrrx�localsr�r�rTrf�_get_content_typer�rrBr=rEr
�urljoinr��raise_for_statusr��textrjr�	HTTPError�response�status_code�_handle_fail�ConnectionError�Timeoutrr�r�)�clsrYr�r&�
skip_archivesr2r>r�rz�instrT�bad_ext�content_typer|r=�params�query�fragment�resp�excr��reasonrrr r�ls�	+		!$

		(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)rr�r>r�)r�rYrr>r&r�r�rrr r��szHTMLPage._handle_failcCsx|dkrt�}ntj|�\}}}}}|d
krFdS|j|dd�}|j�|jjd	d�S)z;Get the Content-Type of the given url, using a HEAD requestNrr�ftp�ftpsrq�allow_redirectsTzContent-Type)zhttpzhttpszftpzftps)rr�urlsplit�headr�r�r�)r>r2rzr|r=rr	r
rrr r��s
zHTMLPage._get_content_typecCs�t|d�s�d}dd�|jjd�D�}|r~y t|djdd��}Wq~ttfk
rzd}Yq~Xn||_n|jS)N�_api_versioncSs4g|]*}|jdd�j�dkr|�qS)rrqzapi-version)r�r�)r�xrrr rk�s	z(HTMLPage.api_version.<locals>.<listcomp>z.//metarr�)�hasattrrn�findall�intr��	TypeError�
ValueErrorr)r3r�metasrrr �api_version�s zHTMLPage.api_versioncCsgt|d�s`|jjd�}|dk	rQ|jd�rQ|jd�|_q`|j|_n|jS)N�	_base_urlz.//base�href)rrn�findr�rr>)r3r�rrr �base_url�szHTMLPage.base_urlccs�x�|jjd�D]�}|jd�r|jd�}|jtj|j|��}d}|jr�|jdkr�t|jd�o�d|jd�j	�k�}nt
||d|�VqqWdS)zYields all links in the pagez.//arNrm�relr�)rnrr��
clean_linkrr�rrr�r�rl)r3�anchorrr>r�rrr r7�s!zHTMLPage.linksccs<x|j�D]}|Vq
Wx|j�D]}|Vq)WdS)N)�explicit_rel_links�scraped_rel_links)r3r>rrr r�s	zHTMLPage.rel_links�homepage�downloadccs�t|�}x�|jjd�D]�}|jd�r|jd�rt|jd�j��}||@r�|jd�}|jtj|j|��}t	||dd�Vq�qqWdS)z)Yields all links with the given relationsz.//arrrjFN)
r'rnrr�r�r rr�rrl)r3�relsr!�
found_relsrr>rrr r"s
zHTMLPage.explicit_rel_linksccs�x�|j|jfD]�}|j|j�}|s7qn|jj|jd|j��}|sdqn|jd�p�|jd�p�|jd�}|s�qn|jtj	|j
|��}t||dddd�VqWdS)	N�posrPrmr�rjFr�T)�_homepage_re�_download_rer�r��_href_re�endr�r rr�rrl)r3�regexr��
href_matchr>rrr r#&s!-zHTMLPage.scraped_rel_linksz[^a-z0-9$&+,/:;=?@.#%_\\|-]cCs|jjdd�|�S)z�Makes 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|jd��S)Nz%%%2xr)�ordr�)r�rrr �<lambda><sz%HTMLPage.clean_link.<locals>.<lambda>)�	_clean_re�sub)r3r>rrr r 7s	zHTMLPage.clean_link)zhomepagezdownload)r�r�r�r�r�r�r�r)r*�Sr+r4r��classmethodr��staticmethodr�r��propertyrrr7r�r"r#r1r rrrr r�Zs([
r�c@sreZdZdddddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Ze
dd��Ze
dd��Ze
dd��Zdd�Ze
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>r�r�rjr�)r3r>r�r�rjr�rrr r4As
				z
Link.__init__cCs.|jrd|j|jfSt|j�SdS)Nz%s (from %s))r�r>ry)r3rrr r�Is	zLink.__str__cCsd|S)Nz	<Link %s>r)r3rrr �__repr__Osz
Link.__repr__cCs|j|jkS)N)r>)r3�otherrrr �__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|j�S)N)�hashr>)r3rrr �__hash__dsz
Link.__hash__cCs\tj|j�\}}}}}tj|jd��p<|}|sXtd|j��|S)NrdzURL %r produced no filename)rrr>rer�r��AssertionError)r3rZr|r=rrrr rTgs!z
Link.filenamecCstj|j�dS)Nr)rrr>)r3rrr rznszLink.schemecCstj|j�dS)Nrm)rrr>)r3rrr r=rsz	Link.pathcCsttj|jjd���S)Nrd)rrer�r=r�)r3rrr rvsz
Link.splitextcCs|j�dS)NrP)r)r3rrr rSyszLink.extcCs=tj|j�\}}}}}tj||||df�S)N)rrr>�
urlunsplit)r3rzr|r=rr	rrr �url_without_fragment}s!zLink.url_without_fragmentz#egg=([^&]*)cCs,|jj|j�}|sdS|jd�S)NrP)r�r�r>r�)r3r�rrr r��szLink.egg_fragmentz2(sha1|sha224|sha384|sha256|sha512|md5)=([a-f0-9]+)cCs,|jj|j�}|r(|jd�SdS)Nrm)�_hash_rer�r>r�)r3r�rrr r?�s
z	Link.hashcCs,|jj|j�}|r(|jd�SdS)NrP)rDr�r>r�)r3r�rrr �	hash_name�s
zLink.hash_namecCs0tj|jjdd�djdd�d�S)Nr�rPr�?)rer�r>r�)r3rrr �show_url�sz
Link.show_urlcCs�|jpt|jdd�}|dk	r�|r�y%t|jdd�}t|�}Wnttfk
rud}YnX|dks�|dkr�dS|jr�dSdSn|dk	r�dSdS)z�
        Returns True if this link can be verified after download, False if it
        cannot, and None if we cannot determine.
        rjNrrPTF)rjr�r�rrrr?)r3rjrrrr r��s	zLink.verifiable)r�r�r�r4r�r7r9r:r;r<r=r>r@r6rTrzr=rrSrCr�r�r�r�rDr?rErGr�rrrr rl?s0	rlcCs;t|�}|j}|s1t|j�d}nt|�S)zPGet a requirement from the URL, if possible.  This looks for #egg
    in the URLr)rlr�rrT�package_to_requirement)r>rYr�rrr �get_requirement_from_url�s
	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)r�r�r�)�package_namer�rrorrr rH�srH)2r�r�rBr�r:re�pip.logr�pip.utilrrrr�pip.exceptionsrrr	r
rZpip.backwardcompatrr
�pip.downloadrrr�	pip.wheelrrZpip.pep425tagsrrr�pip._vendorrrrZpip._vendor.requests.exceptionsr�__all__�DEFAULT_MIRROR_HOSTNAMEr{�objectrr%r�rlrRrIrHrrrr �<module>s6"(	
����