????

Your IP : 216.73.216.152


Current Path : /proc/self/root/proc/self/root/lib/python2.7/site-packages/wheel/tool/
Upload File :
Current File : //proc/self/root/proc/self/root/lib/python2.7/site-packages/wheel/tool/__init__.pyc

�
��]c@sGdZddlZddlZddlZddlZddlZddlmZddl	m
Z
ddlmZm
Z
mZmZmZddlmZd�ZddlZd	efd
��YZd�Zed�Zeed
�Zd�Zd�Zdd�Zddeeed�Zd�Zd�Z d�Z!d�Z"dS(s
Wheel command-line utility.
i����N(tiglobi(t
signatures(turlsafe_b64decodeturlsafe_b64encodetnativetbinarytmatches_requirement(t	WheelFilecCs=yddl}Wn&tk
r8tdj|���nXdS(Ni����s/'{0}' needs pkg_resources (part of setuptools).(t
pkg_resourcestImportErrortRuntimeErrortformat(tnameR((s2/tmp/pip-build-tmgNo5/wheel/wheel/tool/__init__.pytrequire_pkgresourcess
t
WheelErrorcBseZRS((t__name__t
__module__(((s2/tmp/pip-build-tmgNo5/wheel/wheel/tool/__init__.pyRscCshy5ddlm}ddl}|j�js4t�Wn#ttfk
rZtd��nX|j|fS(Ni(tkeysi����sQInstall wheel[signatures] (requires keyring, keyrings.alt, pyxdg) for signatures.(	RRtkeyringtget_keyringtprioritytAssertionErrorR	Rt	WheelKeys(RR((s2/tmp/pip-build-tmgNo5/wheel/wheel/tool/__init__.pyRsc
Cs%|�\}}tj�}|�j�}|j�}tt|j��}tt|j��}|j�}|j	d||�t
jjdj
|��t
jjdj
|��|jd|�}	|	|kr�td��nt
jjdj
|��|jd|�|jd|�|j�dS(s#Generate a public/private key pair.twheels$Created Ed25519 keypair with vk={0}
s	in {0!r}
s1Keyring is broken. Could not retrieve secret key.s.Trusting {0} to sign and verify all packages.
t+N(Rt
get_ed25519lltloadtcrypto_sign_keypairRRtvktskRtset_passwordtsyststdouttwriteRtget_passwordRt
add_signerttrusttsave(
RRRt	ed25519lltwktkeypairRRtkrtsk2((s2/tmp/pip-build-tmgNo5/wheel/wheel/tool/__init__.pytkeygen%s"cCs�|�\}}tj�}t|dt�}|�j�}|jjd�}|j|�d}	tj	j
dj||	d��|	d}
|j�}|j
d|
�}|jtt|
��tt|���}
|jd}|jd}||jj�krtd	��n|jj|�}id
tttj|�j���d6}tj||
�}|jj|tj|dt��|jj�d
S(sSign a wheeltappendRisSigning {0} with {1}
iRs/RECORDs/RECORD.jwssWheel is already signed.ssha256=thasht	sort_keysN( RRRtTrueRtparsed_filenametgrouptsignersRR R!RRR"tKeypairRRt
distinfo_nametzipfiletnamelistRtreadRRthashlibtsha256tdigesttsigntwritestrtjsontdumpstclose(t	wheelfiletreplaceRRRR&twfR'Rt	sign_withRR)RR(trecord_nametsig_nametrecord_datatpayloadtsig((s2/tmp/pip-build-tmgNo5/wheel/wheel/tool/__init__.pyR;>s* 


,"cCsvddl}|jj|d�}|j�}t|�oL|djjd�s^td��n|j�|j	�dS(s$
    Remove RECORD.jws from a wheel by truncating the zip file.

    RECORD.jws must be at the end of the archive. The zip file must be an
    ordinary archive, with the compressed files and the directory in the same
    order, and without any non-zip content after the truncation point.
    i����Ntas/RECORD.jwss'RECORD.jws not found at end of archive.(
t
wheel.installtinstalltVerifyingZipFiletinfolisttlentfilenametendswithRtpopR?(R@Rtvzftinfo((s2/tmp/pip-build-tmgNo5/wheel/wheel/tool/__init__.pytunsign\s"
cCs�t|�}|jd}tjt|jj|�j���}tj	|�}t
jjd�t
j
jtj|dd��t
j
jd�dS(s�Verify a wheel.

    The signature will be verified for internal consistency ONLY and printed.
    Wheel's own unpack/install commands verify the manifest against the
    signature and file contents.
    s/RECORD.jwss&Signatures are internally consistent.
tindentis
N(RR4R=tloadsRR5topenR7RtverifyRtstderrR!R R>(R@RBRERHtverified((s2/tmp/pip-build-tmgNo5/wheel/wheel/tool/__init__.pyRXls
't.cCsht|�}|jjd�}tjj||�}tjjd|�|j	j
|�|j	j�dS(sUnpack a wheel.

    Wheel content will be unpacked to {dest}/{name}-{ver}, where {name}
    is the package name and {ver} its version.

    :param wheelfile: The path to the wheel.
    :param dest: Destination directory (default to current directory).
    tnameversUnpacking to: %s
N(RR0R1tostpathtjoinRRYR!R5t
extractallR?(R@tdestRBR\tdestination((s2/tmp/pip-build-tmgNo5/wheel/wheel/tool/__init__.pytunpack{s	cCs�|sBtjd�}|r0|jtj�}qBtjjg}ng}xn|D]f}x]tj|�D]L}	|	jd�rettjj	||	��}
|
j
r�|j|
�q�qeqeWqOW|r;tjj|�sxB|D]7}tjj	||�}tjj|�r�|}Pq�q�Wnt
|��}|j|�WdQXng}
x�|D]�}|jd�r�tjj|�r�t|�}
|
j
s�|r�|
j|
�q�dj|�}t|��qHtdj|���qHnt||�}|stdj|���n|
jt|��qHW|r0tjjd�n|r:dSxS|
D]K}
|rotjjdj|
j��qAn|
jd	|�|
jj�qAWdS(
s�Install wheels.

    :param requirements: A list of requirements or wheel files to install.
    :param requirements_file: A file containing requirements to install.
    :param wheel_dirs: A list of directories to search for wheels.
    :param force: Install a wheel file even if it is not compatible.
    :param list_files: Only list the files to install, don't install them.
    :param dry_run: Do everything but the actual install.
    t	WHEELPATHs.whlNsB{0} is not compatible with this Python. --force to install anyway.sNo such wheel file: {}sNo match for requirement {}sInstalling:
s    {0}
tforce(R]tgetenvtsplittpathsepR^tcurdirtlistdirRPRR_t
compatibleR,texistsRWtextendRRRtmaxRR R!RORKR5R?(trequirementstrequirements_filet
wheel_dirsRet
list_filestdry_runt	wheelpatht
all_wheelstdtwRBRtfdt
to_installtreqtmsgtmatches((s2/tmp/pip-build-tmgNo5/wheel/wheel/tool/__init__.pyRK�s^
	

	
cCs�y ddlm}ddl}Wntk
r?td��nXxd|D]\}|j|�}tjj|�}|j|j	�}dg|_
|j�|j|�qGWdS(sQ
    Regenerate the entry_points console_scripts for the named distribution.
    i����(teasy_installNs)'wheel install_scripts' needs setuptools.R(
tsetuptools.commandR}RR	R
tget_distributionRtpathstget_install_commandtdistributiontargstfinalize_optionstinstall_egg_scripts(t
distributionsR}Rtdisttpkg_resources_distRKtcommand((s2/tmp/pip-build-tmgNo5/wheel/wheel/tool/__init__.pytinstall_scripts�s


cCs�td�ddlm}ddlm}x�|D]�}x�t|�D]�}tjj|�ddkro|}n|}|r�tj	j
dj|��tj	j�n|||�|rDtj	j
d�qDqDWq1WdS(	Ns
wheel converti(tbdist_wininst2wheel(t	egg2wheelis.eggs{0}... sOK
(
R
t
wininst2wheelR�R�RR]R^tsplitextRR R!Rtflush(t
installerstdest_dirtverboseR�R�tpatt	installertconv((s2/tmp/pip-build-tmgNo5/wheel/wheel/tool/__init__.pytconvert�s

	
csdtj���jdd�}d�}|jddd�}|jd|�d�}|jddd	�}|jd
dd�|jd|�d�}|jd
dtj�}|jd
dd�|jd|�d�}|jddtj�}|jd
dd�|jd|�d�}	|jddd�}
|
jdddddd�|
jd
dd�|
jd|	�d�}|jddd�}|jddddd�|jddt	d d!dd"�|jd#dd d$d%d&dd'�|jd(d)dd*�|jd+d,dt	d%d-d d!dd.�|jd|�d/�}
|jd0dd1�}|jd2dddd3�|jd|
�d4�}|jd5dd6�}|jd7dddd8�|jd9ddt
jjdd:�|jd;d<d d!�|jd|�d=�}|jd>dd?�}|jd|��fd@�}|jdddA�}|jd|��S(BNthelptcommandscSst�dS(N(R+(R�((s2/tmp/pip-build-tmgNo5/wheel/wheel/tool/__init__.pytkeygen_f
sR+sGenerate signing keytfunccSst|j�dS(N(R;R@(R�((s2/tmp/pip-build-tmgNo5/wheel/wheel/tool/__init__.pytsign_fsR;s
Sign wheelR@s
Wheel filecSst|j�dS(N(RTR@(R�((s2/tmp/pip-build-tmgNo5/wheel/wheel/tool/__init__.pytunsign_fsRTcSst|j�dS(N(RXR@(R�((s2/tmp/pip-build-tmgNo5/wheel/wheel/tool/__init__.pytverify_fsRXcSst|j|j�dS(N(RcR@Ra(R�((s2/tmp/pip-build-tmgNo5/wheel/wheel/tool/__init__.pytunpack_f!sRcsUnpack wheels--dests-dsDestination directorytdefaultR[cSs)t|j|j|j|j|j�dS(N(RKRoRpRqReRr(R�((s2/tmp/pip-build-tmgNo5/wheel/wheel/tool/__init__.pyt	install_f)sRKsInstall wheelsRotnargst*sRequirements to install.s--forcetactiont
store_trues!Install incompatible wheel files.s--wheel-dirR,RaRqsDirectories containing wheels.s--requirements-files-rs*A file containing requirements to install.s--lists-lRrsJList wheels which would be installed, but don't actually install anything.cSst|j�dS(N(R�R�(R�((s2/tmp/pip-build-tmgNo5/wheel/wheel/tool/__init__.pytinstall_scripts_f?ssinstall-scriptssInstall console_scriptsR�s2Regenerate console_scripts for these distributionscSst|j|j|j�dS(N(R�R�R�R�(R�((s2/tmp/pip-build-tmgNo5/wheel/wheel/tool/__init__.pyt	convert_fFsR�sConvert egg or wininst to wheelR�sInstallers to converts
--dest-dirs/Directory to store wheels (default %(default)s)s	--verboses-vcSs(ddlm}tjjd|�dS(Ni(t__version__s	wheel %s
(tR�RR R!(R�R�((s2/tmp/pip-build-tmgNo5/wheel/wheel/tool/__init__.pyt	version_fOstversionsPrint version and exitcs�j�dS(N(t
print_help(R�(tp(s2/tmp/pip-build-tmgNo5/wheel/wheel/tool/__init__.pythelp_fUssShow this help(
targparsetArgumentParsertadd_subparserst
add_parsertset_defaultstadd_argumentRTt__doc__RXtFalseR]R^Ri(tsR�t
keygen_parserR�tsign_parserR�t
unsign_parserR�t
verify_parserR�t
unpack_parserR�tinstall_parserR�tinstall_scripts_parserR�tconvert_parserR�tversion_parserR�thelp_parser((R�s2/tmp/pip-build-tmgNo5/wheel/wheel/tool/__init__.pytparsersv									cCswt�}|j�}t|d�s1|j�nBy|j|�dSWn*tk
rr}tjj|j	d�nXdS(NR�is
i(
R�t
parse_argsthasattrR�R�RRRYR!tmessage(R�R�te((s2/tmp/pip-build-tmgNo5/wheel/wheel/tool/__init__.pytmain\s	

(#R�R]R8RR=twheel.pathsRtglobRR�RtutilRRRRRRKRR
R�t	ExceptionRRR+R�R;RTRXRctNoneR�R�R�R�(((s2/tmp/pip-build-tmgNo5/wheel/wheel/tool/__init__.pyt<module>s2(						S			V