Your IP : 3.147.103.33


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

�
7�Re@Qc@sZdZddlmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZddl
mZddlmZmZddlmZmZddlmZdd	lmZdd
lmZddlmZmZmZddlm Z dd
l!m"Z"ddlm Z dZ#d.Z$dd/dd�Z%ye&dd�Z'Wne(k
r�dd�Z'YnXdd�Z)dd�Z*ej+dej,�Z-dd�Z.dd�Z/d0ddd1ddd d!�Z3d"d#�Z4e4d$d%��Z5d&d'�Z6d(d)�Z7Gd*d+�d+e8�Z9Gd,d-�d-e8�Z:dS(2uH
Support for installing and building the "wheel" binary package format.
i(uwith_statementN(uurlsafe_b64encode(uParser(uConfigParseruStringIO(uInvalidWheelFilenameuUnsupportedWheel(udistutils_scheme(ulogger(u
pep425tags(ucall_subprocessunormalize_pathumake_path_relative(u
pkg_resources(uScriptMakeru.whliusha256ic
Cs�tj|�}d}t|d��O}|j|�}x6|rn|t|�7}|j|�|j|�}q9WWdQXdt|j��jd�j	d�}||fS(u6Return (hash, length) for path using hashlib.new(algo)iurbNusha256=ulatin1u=(
uhashlibunewuopenureadulenuupdateuurlsafe_b64encodeudigestudecodeurstrip(upathualgou	blocksizeuhulengthufublockudigest((u"/tmp/pip-zej_zi-build/pip/wheel.pyurehash"s	
(urehashcCs t|t�r|jd�S|S(Nuascii(u
isinstanceuunicodeuencode(us((u"/tmp/pip-zej_zi-build/pip/wheel.pyubinary1s
ubinarycCs t|t�r|jd�SdS(Nuascii(u
isinstanceustruencode(us((u"/tmp/pip-zej_zi-build/pip/wheel.pyubinary6scCsItjddkr"i}d}nidd6}d}t||||�S(Niiubuunewline(usysuversion_infouopen(unameumodeunlubin((u"/tmp/pip-zej_zi-build/pip/wheel.pyuopen_for_csv:s	
uopen_for_csvcCs�tjj|�r�t|d�}zj|j�}|jtd��sIdStj	j
tj��}td�|ttj�}|j
�}Wd|j�Xt|d�}z|j|�|j|�Wd|j�XdSdS(uLReplace #!python with #!/path/to/python
    Return True if file was changed.urbu#!pythonu#!NuwbFT(uosupathuisfileuopenureadlineu
startswithubinaryuFalseusysu
executableuencodeugetfilesystemencodingulinesepureaducloseuwriteuTrue(upathuscriptu	firstlineuexenameurest((u"/tmp/pip-zej_zi-build/pip/wheel.pyu
fix_scriptCs 
u
fix_scriptuZ^(?P<namever>(?P<name>.+?)(-(?P<ver>\d.+?))?)
                                \.dist-info$cCs�|jdd�}x�tj|�D]�}tj|�}|r"|jd�|kr"ttjj||d���:}x0|D](}|j	�j
�}|dkrzdSqzWWdQXq"q"WdS(	uP
    Return True if the extracted wheel in wheeldir should go into purelib.
    u-u_unameuWHEELuroot-is-purelib: trueNTF(
ureplaceuosulistdirudist_info_reumatchugroupuopenupathujoinulowerurstripuTrueuFalse(unameuwheeldiruname_foldeduitemumatchuwheeluline((u"/tmp/pip-zej_zi-build/pip/wheel.pyuroot_is_purelib]s!
uroot_is_purelibc
Cs�tjj|�siifSt|��N}t�}x.|D]&}|j|j��|jd�q;W|jd�WdQXtj	�}|j
|�i}i}|jd�r�t|j
d��}n|jd�r�t|j
d��}n||fS(Nu
iuconsole_scriptsugui_scripts(uosupathuexistsuopenuStringIOuwriteustripuseekuConfigParseruRawConfigParserureadfpuhas_sectionudictuitems(ufilenameufpudataulineucpuconsoleugui((u"/tmp/pip-zej_zi-build/pip/wheel.pyuget_entrypointsms"
	

uget_entrypointsc	$s(|s't|d|d|d|�}nt|��rC|d�n
|d�g�g��jtjj�tjj}	i�t��g}
|r�tj|	dd0dd0�ndd	��d1�����fd
d��	dd���	�
fdd
�}||	�d0��s#td�
��tjj
�dd�}t|�\����fdd�}
x��D]�}d}d}x�tjtjj
�|��D]e}d}|dkr�t}|
}ntjj
�||�}	||}||	|d1d|d|�q�WqjWtd|d��td2��_d0�_�fdd�}|�_d�_�jdd�}|rSdtjkr�d|}|
j�j|��ntjjdd�dkr�dtjdd �|f}|
j�j|��ndtjdd!�|f}|
j�j|��d"d#��D�}x|D]
}�|=q?Wn�jd$d�}|r�dtjkr�d%|}|
j�j|��nd&tjdd!�|f}|
j�j|��d'd#��D�}x|D]
}�|=q�Wnt��dkr<|
j�jd(d#��j�D���nt��dkr�|
j�jd)d#��j�D�id0d*6��ntjj
�dd+�}tjj
�dd,�}t |d-��M}t |d.��5}t!j"|�}t!j#|�}xj|D]b} �j| d| d�| d<| d�krTt$| d�\| d <| d/<n|j%| �q�Wxu|
D]m}!t$|!�\}"}#|r�|!j&|�r�tjj
tjtjj'|!|��}!n|j%|!|"|#f�qlWx(�D] }!|j%�|!ddf�q�WWdQXWdQXt(j)||�dS(3uInstall a wheeluuseruhomeurootupurelibuplatlibuforceuquietcSst||�jtjjd�S(Nu/(umake_path_relativeureplaceuosupathusep(usrcup((u"/tmp/pip-zej_zi-build/pip/wheel.pyunormpath�su"move_wheel_files.<locals>.normpathcsB�|��}�|��}|�|<|r>�j|�ndS(u6Map archive RECORD paths to installation RECORD paths.N(uadd(usrcfileudestfileumodifieduoldpathunewpath(uchangedu	installedulib_dirunormpathuwheeldir(u"/tmp/pip-zej_zi-build/pip/wheel.pyurecord_installed�s

u*move_wheel_files.<locals>.record_installedcs&tjj|�s"tj|�nx�tj|�D]�\}}}|t|�d�jtjj�}tjj||�}	|r�|j	tjjd�dj
d�r�q2nx�|D]�}
tjj|||
�}|r|dkr|j
d�r�j|
�q�q�|r�|
j
d�r�|
j�j
�jjdd�j��r��sWtd���j|�q�q�Wx�|D]�}|r�||�r�qrntjj||�}
tjj|||�}tjj|	�s�tj|	�ntj|
|�d	}|r
||�}n�|
||�qrWq2WdS(
Niiu.datauu
.dist-infou-u_uMultiple .dist-info directoriesF(uosupathuexistsumakedirsuwalkulenulstripusepujoinusplituendswithuappenduloweru
startswithuproject_nameureplaceuAssertionErrorushutilucopy2uFalse(usourceudestuis_baseufixerufilterudirusubdirsufilesubasedirudestdirusu
destsubdirufusrcfileudestfileuchanged(u	data_dirsuinfo_dirurecord_installedureq(u"/tmp/pip-zej_zi-build/pip/wheel.pyuclobber�s:%+
!
*
u!move_wheel_files.<locals>.clobberu!%s .dist-info directory not foundiuentry_points.txtcs�|j�jd�r(|dd�}nV|j�jd�rP|dd�}n.|j�jd�rx|dd�}n|}|�kp�|�kS(	Nu.exeiu
-script.pyi
u.pyai����i����i����(uloweruendswith(unameu	matchname(uconsoleugui(u"/tmp/pip-zej_zi-build/pip/wheel.pyuis_entrypoint_wrapper�su/move_wheel_files.<locals>.is_entrypoint_wrapperuscriptsufixerufilterucs6�ji|jd6|jjd�dd6|jd6S(Numoduleu.iuimport_nameufunc(uscript_templateuprefixusuffixusplit(uentry(umaker(u"/tmp/pip-zej_zi-build/pip/wheel.pyu_get_script_text	s	
u*move_wheel_files.<locals>._get_script_textu�# -*- coding: utf-8 -*-
import re
import sys

from %(module)s import %(import_name)s

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(%(func)s())
upipuENSUREPIP_OPTIONSupip = u
altinstallu
pip%s = %sNiicSs(g|]}tjd|�r|�qS(upip(\d(\.\d)?)?$(ureumatch(u.0uk((u"/tmp/pip-zej_zi-build/pip/wheel.pyu
<listcomp>Js	u$move_wheel_files.<locals>.<listcomp>ueasy_installueasy_install = ueasy_install-%s = %scSs(g|]}tjd|�r|�qS(ueasy_install(-\d\.\d)?$(ureumatch(u.0uk((u"/tmp/pip-zej_zi-build/pip/wheel.pyu
<listcomp>Vs	cSsg|]}d|�qS(u%s = %s((u.0ukv((u"/tmp/pip-zej_zi-build/pip/wheel.pyu
<listcomp>]s	cSsg|]}d|�qS(u%s = %s((u.0ukv((u"/tmp/pip-zej_zi-build/pip/wheel.pyu
<listcomp>_s	uguiuRECORDu
RECORD.pipuruw+iTF(u(*udistutils_schemeuroot_is_pureliburstripuosupathusepusetu
compileallucompile_diruTrueuFalseuNoneuAssertionErrorujoinuget_entrypointsulistdiru
fix_scriptuScriptMakeruvariantsuset_modeu_get_script_textuscript_templateupopuenvironuextendumakeugetusysuversionulenu
make_multipleuitemsuopen_for_csvucsvureaderuwriterurehashuwriterowu
startswithurelpathushutilumove($unameurequwheeldiruuseruhomeurootu	pycompileuschemeustrip_file_prefixusourceu	generateduclobberuep_fileuis_entrypoint_wrapperudatadirufixerufilterusubdirudestu_get_script_textu
pip_scriptuspecupip_epukueasy_install_scriptueasy_install_epurecordutemp_recordu	record_inu
record_outureaderuwriterurowufuhul((uchangeduconsoleu	data_dirsuguiuinfo_diru	installedulib_dirumakerunormpathurecord_installedurequwheeldiru"/tmp/pip-zej_zi-build/pip/wheel.pyumove_wheel_files�s�!

	!!(
%	
$		
	#



,6
!
*
*umove_wheel_filescs%tj���fdd��}|S(Nc?sHt�}x8�||�D]'}||kr|j|�|VqqWdS(N(usetuadd(uargsukwuseenuitem(ufn(u"/tmp/pip-zej_zi-build/pip/wheel.pyuuniquevs
	
u_unique.<locals>.unique(u	functoolsuwraps(ufnuunique((ufnu"/tmp/pip-zej_zi-build/pip/wheel.pyu_uniqueus!u_uniqueccs�ddlm}tj||jd���}x�|D]}tjj|j|d�}|V|j	d�r5tjj
|�\}}|dd�}tjj||d�}|Vq5q5WdS(	u
    Yield all the uninstallation paths for dist based on RECORD-without-.pyc

    Yield paths to all the files in RECORD. For each .py file in RECORD, add
    the .pyc in the same directory.

    UninstallPathSet.add() takes care of the __pycache__ .pyc.
    i(uFakeFileuRECORDu.pyNiu.pyci����(upip.requFakeFileucsvureaderuget_metadata_linesuosupathujoinulocationuendswithusplit(udistuFakeFileururowupathudnufnubase((u"/tmp/pip-zej_zi-build/pip/wheel.pyuuninstallation_paths�s

uuninstallation_pathscCs�yzdd�tjd|�D�d}|jd�}t�j|�}|dj�}ttt	|j
d���}|SWndSYnXdS(	u�
    Return the Wheel-Version of an extracted wheel, if possible.

    Otherwise, return False if we couldn't parse / extract it.
    cSsg|]}|�qS(((u.0ud((u"/tmp/pip-zej_zi-build/pip/wheel.pyu
<listcomp>�s	u!wheel_version.<locals>.<listcomp>iuWHEELu
Wheel-Versionu.NF(u
pkg_resourcesufind_on_pathuNoneuget_metadatauParseruparsestrustriputupleumapuintusplituFalse(u
source_dirudistu
wheel_datauversion((u"/tmp/pip-zej_zi-build/pip/wheel.pyu
wheel_version�s#u
wheel_versioncCs�|std|��n|dtdkrXtd|djtt|��f��n2|tkr�tjddjtt|���ndS(u�
    Raises errors or warns if called with an incompatible Wheel-Version.

    Pip should refuse to install a Wheel-Version that's a major series
    ahead of what it's compatible with (e.g 2.0 > 1.1); and warn when
    installing a version only minor version ahead (e.g 1.2 > 1.1).

    version: a 2-tuple representing a Wheel-Version (Major, Minor)
    name: name of wheel or package to raise exception about

    :raises UnsupportedWheel: when an incompatible Wheel-Version is given
    u(%s is in an unsupported or invalid wheeliuB%s's Wheel-Version (%s) is not compatible with this version of pipu.u*Installing from a newer Wheel-Version (%s)N(uUnsupportedWheeluVERSION_COMPATIBLEujoinumapustruloggeruwarn(uversionuname((u"/tmp/pip-zej_zi-build/pip/wheel.pyucheck_compatibility�s
%	ucheck_compatibilitycBsY|EeZdZdZejdej�Zdd�Zd	dd�Z
d	dd�Zd	S(
uWheeluA wheel fileu�^(?P<namever>(?P<name>.+?)-(?P<ver>\d.*?))
                ((-(?P<build>\d.*?))?-(?P<pyver>.+?)-(?P<abi>.+?)-(?P<plat>.+?)
                \.whl|\.dist-info)$cs��jj|�}|s+td|��n|�_|jd�jdd��_|jd�jdd��_|jd�jd��_	|jd�jd��_
|jd	�jd��_t�fd
d��j	D���_
dS(
uX
        :raises InvalidWheelFilename: when the filename is invalid for a wheel
        u!%s is not a valid wheel filename.unameu_u-uverupyveru.uabiuplatc3s>|]4}�jD]$}�jD]}|||fVqqqdS(N(uabisuplats(u.0uxuyuz(uself(u"/tmp/pip-zej_zi-build/pip/wheel.pyu	<genexpr>�su!Wheel.__init__.<locals>.<genexpr>N(u
wheel_file_reumatchuInvalidWheelFilenameufilenameugroupureplaceunameuversionusplitu
pyversionsuabisuplatsusetu	file_tags(uselfufilenameu
wheel_info((uselfu"/tmp/pip-zej_zi-build/pip/wheel.pyu__init__�s	uWheel.__init__csH�dkrtj�n�fdd�|jD�}|rDt|�SdS(u"
        Return the lowest index that one of the wheel's file_tag combinations
        achieves in the supported_tags list e.g. if there are 8 supported tags,
        and one of the file tags is first in the list, then return 0.  Returns
        None is the wheel is not supported.
        cs+g|]!}|�kr�j|��qS((uindex(u.0uc(utags(u"/tmp/pip-zej_zi-build/pip/wheel.pyu
<listcomp>�s	u+Wheel.support_index_min.<locals>.<listcomp>N(uNoneu
pep425tagsusupported_tagsu	file_tagsumin(uselfutagsuindexes((utagsu"/tmp/pip-zej_zi-build/pip/wheel.pyusupport_index_min�suWheel.support_index_mincCs4|dkrtj}ntt|�j|j��S(u'Is this wheel supported on this system?N(uNoneu
pep425tagsusupported_tagsuboolusetuintersectionu	file_tags(uselfutags((u"/tmp/pip-zej_zi-build/pip/wheel.pyu	supported�suWheel.supportedN(u__name__u
__module__u__qualname__u__doc__ureucompileuVERBOSEu
wheel_file_reu__init__uNoneusupport_index_minu	supported(u
__locals__((u"/tmp/pip-zej_zi-build/pip/wheel.pyuWheel�suWheelcBsD|EeZdZdZggdd�Zdd�Zdd�ZdS(	uWheelBuilderu#Build wheels from a RequirementSet.cCs7||_||_t|�|_||_||_dS(N(urequirement_setufinderunormalize_pathu	wheel_diru
build_optionsuglobal_options(uselfurequirement_setufinderu	wheel_diru
build_optionsuglobal_options((u"/tmp/pip-zej_zi-build/pip/wheel.pyu__init__�s
			uWheelBuilder.__init__cCs�tjdd|jgt|j�}tjd|j�tjd|j�|dd|jg|j	}y!t
|d|jdd�dSWn tjd	|j�dSYnXd
S(
uBuild one wheel.u-cujimport setuptools;__file__=%r;exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))u#Running setup.py bdist_wheel for %suDestination directory: %subdist_wheelu-ducwdushow_stdoutuFailed building wheel for %sNFT(usysu
executableusetup_pyulistuglobal_optionsuloggerunotifyunameu	wheel_diru
build_optionsucall_subprocessu
source_diruFalseuTrueuerror(uselfurequ	base_argsu
wheel_args((u"/tmp/pip-zej_zi-build/pip/wheel.pyu
_build_ones	
uWheelBuilder._build_onecCs5|jj|j�|jjj�}dd�|D�}|sBdStjddjdd�|D���tjd7_gg}}x:|D]2}|j	|�r�|j
|�q�|j
|�q�Wtjd8_|rtjdd	jd
d�|D���n|r1tjdd	jdd�|D���ndS(
u
Build wheels.cSsg|]}|js|�qS((uis_wheel(u.0ureq((u"/tmp/pip-zej_zi-build/pip/wheel.pyu
<listcomp>s	u&WheelBuilder.build.<locals>.<listcomp>Nu*Building wheels for collected packages: %su,cSsg|]}|j�qS((uname(u.0ureq((u"/tmp/pip-zej_zi-build/pip/wheel.pyu
<listcomp>#s	iuSuccessfully built %su cSsg|]}|j�qS((uname(u.0ureq((u"/tmp/pip-zej_zi-build/pip/wheel.pyu
<listcomp>0s	uFailed to build %scSsg|]}|j�qS((uname(u.0ureq((u"/tmp/pip-zej_zi-build/pip/wheel.pyu
<listcomp>2s	(urequirement_setu
prepare_filesufinderurequirementsuvaluesuloggerunotifyujoinuindentu
_build_oneuappend(uselfureqsetubuildsetu
build_successu
build_failureureq((u"/tmp/pip-zej_zi-build/pip/wheel.pyubuilds&

*uWheelBuilder.buildN(u__name__u
__module__u__qualname__u__doc__u__init__u
_build_oneubuild(u
__locals__((u"/tmp/pip-zej_zi-build/pip/wheel.pyuWheelBuilder�suWheelBuilder(iiiFT(;u__doc__u
__future__uwith_statementu
compileallucsvu	functoolsuhashlibuosureushutilusysubase64uurlsafe_b64encodeuemail.parseruParserupip.backwardcompatuConfigParseruStringIOupip.exceptionsuInvalidWheelFilenameuUnsupportedWheelu
pip.locationsudistutils_schemeupip.loguloggerupipu
pep425tagsupip.utilucall_subprocessunormalize_pathumake_path_relativeupip._vendoru
pkg_resourcesupip._vendor.distlib.scriptsuScriptMakeru	wheel_extuVERSION_COMPATIBLEurehashuunicodeubinaryu	NameErroruopen_for_csvu
fix_scriptucompileuVERBOSEudist_info_reuroot_is_purelibuget_entrypointsuFalseuNoneuTrueumove_wheel_filesu_uniqueuuninstallation_pathsu
wheel_versionucheck_compatibilityuobjectuWheeluWheelBuilder(((u"/tmp/pip-zej_zi-build/pip/wheel.pyu<module>sT

		�2

?>