ok

Mini Shell

Direktori : /proc/thread-self/root/usr/lib/python2.7/site-packages/pip/
Upload File :
Current File : //proc/thread-self/root/usr/lib/python2.7/site-packages/pip/wheel.pyc

�
��abc	@@s
dZddlmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z	ddlZddlZddl
Z
ddlZddlZddlZddlmZddlmZddlmZddlZddlmZddlmZmZdd	lmZmZm Z dd
l!m"Z"m#Z#ddlm$Z$ddl%m&Z&m'Z'm(Z(m)Z)m*Z*dd
l+m,Z,ddl-m.Z.ddl/m0Z0ddl1m2Z2ddl3m4Z4ddl5m6Z6ddl7m8Z8dZ9ddfZ:ej;e<�Z=de>fd��YZ?d�Z@d�ZAddd>d�ZBd�ZCd�ZDejEdejF�ZGd �ZHd!�ZIeJeKeKeLeKeJeKeKd"�ZMd#�ZNeNd$��ZOd%�ZPd&�ZQd'e>fd(��YZRd)e>fd*��YZSdS(+sH
Support for installing and building the "wheel" binary package format.
i(tabsolute_importN(turlsafe_b64encode(tParser(tStringIO(t
expanduser(tpath_to_urlt
unpack_url(tInstallationErrortInvalidWheelFilenametUnsupportedWheel(tdistutils_schemetPIP_DELETE_MARKER_FILENAME(t
pep425tags(tcall_subprocesst
ensure_dirtcaptured_stdouttrmtreetread_chunks(topen_spinner(t
indent_log(tSETUPTOOLS_SHIM(tScriptMaker(t
pkg_resources(tcanonicalize_name(tconfigparsers.whlit
WheelCachecB@s eZdZd�Zd�ZRS(s&A cache of wheels for future installs.cC@s(|rt|�nd|_||_dS(s�Create a wheel cache.

        :param cache_dir: The root of the cache.
        :param format_control: A pip.index.FormatControl object to limit
            binaries being read from the cache.
        N(RtNonet
_cache_dirt_format_control(tselft	cache_dirtformat_control((s-/usr/lib/python2.7/site-packages/pip/wheel.pyt__init__8scC@st|j||j|�S(N(tcached_wheelRR(Rtlinktpackage_name((s-/usr/lib/python2.7/site-packages/pip/wheel.pyR!Bs(t__name__t
__module__t__doc__R R!(((s-/usr/lib/python2.7/site-packages/pip/wheel.pyR5s	
cC@s�|jg}|jdk	rO|jdk	rO|jdj|j|jg��ndj|�}tj|j��j	�}|d |dd!|dd!|dg}t
jj|d|�S(s�
    Return a directory to store cached wheels in for link.

    Because there are M wheels for any one sdist, we provide a directory
    to cache them in, and then consult that directory when looking up
    cache hits.

    We only insert things into the cache if they have plausible version
    numbers, so that we don't contaminate the cache with things that were not
    unique. E.g. ./package might have dozens of installs done for it and build
    a version of 0.0...and if we built and cached a wheel, we'd end up using
    the same wheel even if the source has been edited.

    :param cache_dir: The cache_dir being used by pip.
    :param link: The link of the sdist for which this will cache wheels.
    t=t#iiitwheelsN(turl_without_fragmentt	hash_nameRthashtappendtjointhashlibtsha224tencodet	hexdigesttostpath(RR"t	key_partstkey_urlthashedtparts((s-/usr/lib/python2.7/site-packages/pip/wheel.pyt_cache_for_linkGs%(c
C@ss|s
|S|s|S|jr!|S|js.|S|s8|St|�}tjj||�}d|kri|St||�}ytj|�}Wn5t	k
r�}|j
t
jt
jfkr�|S�nXg}	x`|D]X}
yt
|
�}Wntk
r�q�nX|j�sq�n|	j|j�|
f�q�W|	s6|S|	j�tjj||	dd�}tjjt|��S(Ntbinaryii(tis_wheeltis_artifactRtpiptindextfmt_ctl_formatsR9R3tlistdirtOSErrorterrnotENOENTtENOTDIRtWheelRt	supportedR-tsupport_index_mintsortR4R.tLinkR(
RR"RR#tcanonical_nametformatstroottwheel_namestet
candidatest
wheel_nametwheelR4((s-/usr/lib/python2.7/site-packages/pip/wheel.pyR!psF		


tsha256icC@s�tj|�}d}t|d��A}x7t|d|�D]#}|t|�7}|j|�q:WWdQXdt|j��jd�j	d�}||fS(s6Return (hash, length) for path using hashlib.new(algo)itrbtsizeNssha256=tlatin1R'(
R/tnewtopenRtlentupdateRtdigesttdecodetrstrip(R4talgot	blocksizethtlengthtftblockRZ((s-/usr/lib/python2.7/site-packages/pip/wheel.pytrehash�scC@sItjddkr"i}d}nidd6}d}t||||�S(Niitbttnewline(tsystversion_infoRW(tnametmodetnltbin((s-/usr/lib/python2.7/site-packages/pip/wheel.pytopen_for_csv�s	
cC@s�tjj|�r�t|d��d}|j�}|jd�sCtStjj	tj
��}d|tjj	d�}|j�}WdQXt|d��!}|j
|�|j
|�WdQXtSdS(sLReplace #!python with #!/path/to/python
    Return True if file was changed.RSs#!pythons#!tasciiNtwb(R3R4tisfileRWtreadlinet
startswithtFalseRgt
executableR1tgetfilesystemencodingtlineseptreadtwritetTrue(R4tscriptt	firstlinetexenametrest((s-/usr/lib/python2.7/site-packages/pip/wheel.pyt
fix_script�s
sZ^(?P<namever>(?P<name>.+?)(-(?P<ver>\d.+?))?)
                                \.dist-info$cC@s�|jdd�}x�tj|�D]�}tj|�}|r"|jd�|kr"ttjj||d���:}x0|D](}|j	�j
�}|dkrztSqzWWdQXq"q"WtS(sP
    Return True if the extracted wheel in wheeldir should go into purelib.
    t-t_RitWHEELsroot-is-purelib: trueN(
treplaceR3R@tdist_info_retmatchtgroupRWR4R.tlowerR\RyRs(Ritwheeldirtname_foldedtitemR�RQtline((s-/usr/lib/python2.7/site-packages/pip/wheel.pytroot_is_purelib�s!
cC@stjj|�siifSt|��N}t�}x.|D]&}|j|j��|jd�q;W|jd�WdQXtj	�}d�|_
|j|�i}i}|jd�r�t
|jd��}n|jd�r�t
|jd��}n||fS(Ns
icS@s|S(N((toption((s-/usr/lib/python2.7/site-packages/pip/wheel.pyt<lambda>�Retconsole_scriptstgui_scripts(R3R4texistsRWRRxtstriptseekRtRawConfigParsertoptionxformtreadfpthas_sectiontdicttitems(tfilenametfptdataR�tcptconsoletgui((s-/usr/lib/python2.7/site-packages/pip/wheel.pytget_entrypoints�s$
	

c,@s+|s3t|d|d|d|d|d|	�}nt|��rO|d�n
|d�g�g��jtjj�tjj}i�t��g}|rt��@}
tj	��+tj
d�tj|d	t
d
t
�WdQXWdQXtj|
j��nd��t�����fd
��	dd���	�
fd�}||�t
��sktd�
��tjj�dd�}t|�\����fd�}x��D]�}d}d}x�tjtjj�|��D]e}d}|dkrt}|}ntjj�||�}||}|||td|d|�q�Wq�Wtd|d��t
�_td0��_t
�_��
fd�}|�_d�_�jdd�}|r�dtjkr�d|}|j �j!|��ntjj"dd�dkr:dt#j$d |f}|j �j!|��ndt#j$d |f}|j �j!|��g�D]}t%j&d |�rn|^qn}x|D]
}�|=q�Wn�jd!d�}|rjdtjkr�d"|}|j �j!|��nd#t#j$d |f}|j �j!|��g�D]}t%j&d$|�r+|^q+}x|D]
}�|=qVWnt'��dkr�|j �j(g�j)�D]}d%|^q���nt'��dkr|j �j(g�j)�D]}d%|^q�it
d&6��ntjj�dd'�}tjj�dd(�}t*|d)��} | j+d*�WdQXt,j-||�|j.|�tjj�dd+�}!tjj�dd,�}"t/|!d-��\}#t/|"d.��D}$t0j1|#�}%t0j2|$�}&xj|%D]b}'�j|'d|'d�|'d<|'d�krHt3|'d�\|'d<|'d/<n|&j4|'�q�Wx�|D]|}(t3|(�\})}*�|(��}+|
r�|+j5|
�r�tjjtjtjj6|+|
��}+n|&j4|+|)|*f�q`Wx(�D] }(|&j4�|(ddf�q�WWdQXWdQXt,j-|"|!�dS(1sInstall a wheeltuserthomeRLtisolatedtprefixtpurelibtplatlibtignoretforcetquietNcS@s%tjj||�jtjjd�S(Nt/(R3R4trelpathR�tsep(tsrctp((s-/usr/lib/python2.7/site-packages/pip/wheel.pytnormpathsc@sB�|��}�|��}|�|<|r>�j|�ndS(s6Map archive RECORD paths to installation RECORD paths.N(tadd(tsrcfiletdestfiletmodifiedtoldpathtnewpath(tchangedt	installedtlib_dirR�R�(s-/usr/lib/python2.7/site-packages/pip/wheel.pytrecord_installeds

c@s�t|�xztj|�D]i\}}}|t|�jtjj�}tjj||�}	|r�|jtjjd�dj	d�r�qnx�|D]�}
tjj|||
�}|r�|dkr�|j	d�r��j
|
�q�q�|r�|
j	d�r�t|
�jt�j
��r��sBtd|ddj�����j
|�q�q�Wx*|D]"}|r{||�r{q]ntjj||�}
tjj|||�}t|	�tj|
|�tj|
�}ttd�r�tj||j|jf�ntj|
tj�rTtj|
�}|jtjBtjBtjB}tj||�nt}|ro||�}n�|
||�q]WqWdS(	Niis.dataRes
.dist-infos!Multiple .dist-info directories: s, tutime(RR3twalkRXtlstripR4R�R.tsplittendswithR-RRrRitAssertionErrortshutiltcopyfiletstatthasattrR�tst_atimetst_mtimetaccesstX_OKtst_modetS_IXUSRtS_IXGRPtS_IXOTHtchmodRs(tsourcetdesttis_basetfixertfiltertdirtsubdirstfilestbasedirtdestdirtst
destsubdirRaR�R�tsttpermissionsR�(t	data_dirstinfo_dirR�treq(s-/usr/lib/python2.7/site-packages/pip/wheel.pytclobbersJ
+
!



s!%s .dist-info directory not foundisentry_points.txtc@s�|j�jd�r"|d }nJ|j�jd�rD|d }n(|j�jd�rf|d }n|}|�kp�|�kS(Ns.exei����s
-script.pyi����s.pya(R�R�(Rit	matchname(R�R�(s-/usr/lib/python2.7/site-packages/pip/wheel.pytis_entrypoint_wrapperas


tscriptsR�R�Rec@s^|jdkr(td|�f��n�ji|jd6|jjd�dd6|jd6S(Ns�Invalid script entry point: %s for req: %s - A callable suffix is required. Cf https://packaging.python.org/en/latest/distributing.html#console-scripts for more information.tmodulet.itimport_nametfunc(tsuffixRRtscript_templateR�R�(tentry(tmakerR�(s-/usr/lib/python2.7/site-packages/pip/wheel.pyt_get_script_text�s	
s�# -*- 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())
R=tENSUREPIP_OPTIONSspip = t
altinstalls
pip%s = %siispip(\d(\.\d)?)?$teasy_installseasy_install = seasy_install-%s = %sseasy_install(-\d\.\d)?$s%s = %sR�t	INSTALLERs
INSTALLER.pipRospip
tRECORDs
RECORD.piptrsw+i(Re(7R
R�R\R3R4R�tsetRtwarningstcatch_warningstfilterwarningst
compilealltcompile_dirRytloggertdebugtgetvalueRsRR�R.R�R@R~RR�tvariantstset_modeR�R�tpoptenvirontextendtmaketgetRgtversiontreR�RXt
make_multipleR�RWRxR�tmoveR-RmtcsvtreadertwriterRctwriterowRrR�(,RiR�R�R�R�RLt	pycompiletschemeR�R�tstrip_file_prefixR�t	generatedtstdoutR�tep_fileR�tdatadirR�R�tsubdirR�R�t
pip_scripttspectktpip_epteasy_install_scriptteasy_install_eptkvt	installerttemp_installertinstaller_filetrecordttemp_recordt	record_int
record_outRRtrowRaR_tlt
final_path((R�R�R�R�R�R�R�R�R�R�R�R�s-/usr/lib/python2.7/site-packages/pip/wheel.pytmove_wheel_files�s�

	

%	;
%	
$			
	#
+

+
0 

!

*c@s"tj���fd��}|S(Nc?@sHt�}x8�||�D]'}||kr|j|�|VqqWdS(N(R�R�(targstkwtseenR�(tfn(s-/usr/lib/python2.7/site-packages/pip/wheel.pytuniques
	
(t	functoolstwraps(R%R&((R%s-/usr/lib/python2.7/site-packages/pip/wheel.pyt_uniquescc@s�ddlm}tj||jd���}x�|D]y}tjj|j|d�}|V|j	d�r5tjj
|�\}}|d }tjj||d�}|Vq5q5WdS(s
    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(tFakeFileR�s.pyi����s.pycN(t	pip.utilsR*RRtget_metadata_linesR3R4R.tlocationR�R�(tdistR*R�RR4tdnR%tbase((s-/usr/lib/python2.7/site-packages/pip/wheel.pytuninstallation_paths"s


cC@s�y�gtjd|�D]}|^qd}|jd�}t�j|�}|dj�}ttt	|j
d���}|SWntSXdS(s�
    Return the Wheel-Version of an extracted wheel, if possible.

    Otherwise, return False if we couldn't parse / extract it.
    iR�s
Wheel-VersionR�N(Rtfind_on_pathRtget_metadataRtparsestrR�ttupletmaptintR�Rs(t
source_dirtdR.t
wheel_dataR((s-/usr/lib/python2.7/site-packages/pip/wheel.pyt
wheel_version8s)cC@s�|std|��n|dtdkrXtd|djtt|��f��n1|tkr�tjddjtt|���ndS(s�
    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
    s(%s is in an unsupported or invalid wheelisB%s's Wheel-Version (%s) is not compatible with this version of pipR�s*Installing from a newer Wheel-Version (%s)N(R	tVERSION_COMPATIBLER.R6tstrR�twarning(RRi((s-/usr/lib/python2.7/site-packages/pip/wheel.pytcheck_compatibilityKs
%REcB@sDeZdZejdej�Zd�Zdd�Z	dd�Z
RS(sA wheel files�^(?P<namever>(?P<name>.+?)-(?P<ver>\d.*?))
        ((-(?P<build>\d.*?))?-(?P<pyver>.+?)-(?P<abi>.+?)-(?P<plat>.+?)
        \.whl|\.dist-info)$c@s��jj|�}|s+td|��n|�_|jd�jdd��_|jd�jdd��_|jd�jd��_	|jd�jd��_
|jd	�jd��_t�fd
��j	D���_
dS(sX
        :raises InvalidWheelFilename: when the filename is invalid for a wheel
        s!%s is not a valid wheel filename.RiR�RtvertpyverR�tabitplatc3@s>|]4}�jD]$}�jD]}|||fVqqqdS(N(tabistplats(t.0txtytz(R(s-/usr/lib/python2.7/site-packages/pip/wheel.pys	<genexpr>�sN(t
wheel_file_reR�RR�R�R�RiRR�t
pyversionsRDRER�t	file_tags(RR�t
wheel_info((Rs-/usr/lib/python2.7/site-packages/pip/wheel.pyR ts	cC@s]|dkrtj}ng|jD]!}||kr"|j|�^q"}|rYt|�SdS(s"
        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.
        N(RRtsupported_tagsRLR>tmin(Rttagstctindexes((s-/usr/lib/python2.7/site-packages/pip/wheel.pyRG�s1cC@s4|dkrtj}ntt|�j|j��S(s'Is this wheel supported on this system?N(RRRNtboolR�tintersectionRL(RRP((s-/usr/lib/python2.7/site-packages/pip/wheel.pyRF�sN(R$R%R&RtcompiletVERBOSERJR RRGRF(((s-/usr/lib/python2.7/site-packages/pip/wheel.pyREhs	tWheelBuildercB@sSeZdZddd�Zdd�Zd�Zdd�Zd�Ze	d�Z
RS(s#Build wheels from a RequirementSet.cC@sO||_||_|jj|_|j|_|p6g|_|pEg|_dS(N(	trequirement_settfindert_wheel_cacheRt_cache_roottwheel_download_dirt
_wheel_dirt
build_optionstglobal_options(RRXRYR^R_((s-/usr/lib/python2.7/site-packages/pip/wheel.pyR �s		cC@s�tjd�}z�|j||d|�r�y_tj|�d}tjj||�}tjtjj||�|�t	j
d|�|SWq�q�Xn|j|�dSWdt
|�XdS(siBuild one wheel.

        :return: The filename of the built wheel, or None if the build failed.
        s
pip-wheel-t
python_tagisStored in directory: %sN(ttempfiletmkdtempt_WheelBuilder__build_oneR3R@R4R.R�RR�tinfot
_clean_oneRR(RR�t
output_dirR`ttempdRPt
wheel_path((s-/usr/lib/python2.7/site-packages/pip/wheel.pyt
_build_one�s
cC@s'tjddt|jgt|j�S(Ns-us-c(RgRtRtsetup_pytlistR_(RR�((s-/usr/lib/python2.7/site-packages/pip/wheel.pyt_base_setup_args�s
cC@s�|j|�}d|jf}t|���}tjd|�|dd|g|j}|dk	rw|d|g7}ny't|d|jdt	d|�t
SWn(|jd	�tjd
|j�t	SXWdQXdS(Ns#Running setup.py bdist_wheel for %ssDestination directory: %stbdist_wheels-ds--python-tagtcwdtshow_stdouttspinnerterrorsFailed building wheel for %s(
RlRiRR�R�R^RR
tsetup_py_dirRsRytfinishRq(RR�RgR`t	base_argstspin_messageRpt
wheel_args((s-/usr/lib/python2.7/site-packages/pip/wheel.pyt__build_one�s

cC@su|j|�}tjd|j�|ddg}y!t|d|jdt�tSWntjd|j�tSXdS(NsRunning setup.py clean for %stcleans--allRnRos Failed cleaning build dir for %s(	RlR�RdRiR
R8RsRyRq(RR�Rtt
clean_args((s-/usr/lib/python2.7/site-packages/pip/wheel.pyRe�scC@s�|js|r|jst�|jj|j�|jjj�}g}x!|D]}|jreqPn|j	r�|sit
jd|j�qiqP|r�|j
r�qP|r�|jr�|jjr�qP|r�|jr�qP|r\|j}|j�\}}tjj|d
|�d
krqPndtjj|jjt|j��kr\t
jd|j�qPq\n|j|�qPW|swtSt
jddjg|D]}|j^q���t���gg}}	x�|D]{}d
}
|rAtj}
t|j|j�}yt |�WqJt!k
r=}t
j"d|j|�|	j|�q�qJXn	|j}|j#||d|
�}
|
r2|j|�|r?|jr�t$j%j&t$j%j|jt'��r�td��n|j(�|j)|jj*�|_tjj+t,|
��|_|jj	st�t-|j|jd
t.d	|jj/�q?q�|	j|�q�WWd
QX|r�t
jddjg|D]}|j^qe��n|	r�t
jd
djg|	D]}|j^q���nt0|	�dkS(s�Build wheels.

        :param unpack: If True, replace the sdist we built from with the
            newly built wheel, in preparation for installation.
        :return: True if all the wheels built correctly.
        s(Skipping %s, due to already being wheel.R:sCSkipping bdist_wheel for %s, due to binaries being disabled for it.s*Building wheels for collected packages: %ss, s Building wheel for %s failed: %sR`sbad source dir - missing markertsessionNsSuccessfully built %st sFailed to build %si(1R]R[R�RXt
prepare_filesRYtrequirementstvaluest
constraintR;R�RdRiteditableR"R<R8tsplitextR=R>tegg_info_matchesRR?RRR-RyR.RRtimplementation_tagR9RRAR>RiR3R4R�Rtremove_temporary_sourcetbuild_locationt	build_dirRIRRRsRzRX(RtautobuildingtreqsettbuildsetR�R"R0textt
build_successt
build_failureR`RfRNt
wheel_file((s-/usr/lib/python2.7/site-packages/pip/wheel.pytbuild�s�
				
	&


		


			

	))N(R$R%R&RR RiRlRcReRsR�(((s-/usr/lib/python2.7/site-packages/pip/wheel.pyRW�s		(TR&t
__future__RR�RRBR'R/tloggingR3tos.pathRR�R�RgRaR�tbase64Rtemail.parserRtpip._vendor.sixRR=t
pip.compatRtpip.downloadRRtpip.exceptionsRRR	t
pip.locationsR
RRR+R
RRRRtpip.utils.uiRtpip.utils.loggingRtpip.utils.setuptools_buildRtpip._vendor.distlib.scriptsRtpip._vendorRtpip._vendor.packaging.utilsRtpip._vendor.six.movesRt	wheel_extR<t	getLoggerR$R�tobjectRR9R!RcRmR~RURVR�R�R�RsRRyR!R)R1R;R?RERW(((s-/usr/lib/python2.7/site-packages/pip/wheel.pyt<module>sl(	)	'	
				�&			7

Zerion Mini Shell 1.0