ok

Mini Shell

Direktori : /opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/
Upload File :
Current File : //opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pyo

�
x�_c@@s@dZddlmZddlZddlZddlZddlZddlZddlZddl	Z
ddlZddlZddl
Z
ddlZddlmZddlmZmZddlmZddlmZddlmZdd	lmZdd
lmZmZmZm Z m!Z!m"Z"ddl#m$Z$m%Z%ddl&m'Z'dd
l(m)Z)ddl*m+Z+m,Z,ddl-m.Z.ddl/m0Z0m1Z1ddl2m3Z3m4Z4m5Z5m6Z6ddl7m8Z8ddl9m:Z:m;Z;m<Z<m=Z=ddl>m?Z?m@Z@e8r$ddl7mAZAn�ddlBmCZCddlDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZOmPZPmQZQmRZRmAZAddlmSZSddlTmUZUddl-mVZVddl/mWZWeLde"�ZXeQeXeYeReZeYffZ[deNfd��YZ\ej]e^�Z_dd >d!�Z`d"�Zad#�Zbd$�Zcd%�Zdd&�Zed'�Zfd(�Zgehd)�Zid*�Zjd+�Zkd,�Zld-emfd.��YZnd/emfd0��YZod1e'fd2��YZpd3�Zqd4efd5��YZresesehetd6�Zuejvd7��Zwesesehetd8�ZxdS(9sGSupport for installing and building the "wheel" binary package format.
i(tabsolute_importN(turlsafe_b64encode(tchaintstarmap(tZipFile(t
pkg_resources(tScriptMaker(tget_export_entry(tPY2t
ensure_strtensure_textt
itervaluestreraiset	text_type(tfilterfalsetmap(tInstallationError(tget_major_minor_version(tDIRECT_URL_METADATA_NAMEt	DirectUrl(tSCHEME_KEYS(tadjacent_tmp_filetreplace(tcaptured_stdoutt
ensure_dirt	hash_filet	partition(tMYPY_CHECK_RUNNING(t
current_umasktis_within_directoryt2set_extracted_file_to_default_mode_plus_executabletzip_item_is_executable(tparse_wheelt$pkg_resources_distribution_for_wheel(tcast(tMessage(tAnytCallabletDicttIOtIterabletIteratortListtNewTypetOptionaltProtocoltSequencetSettTupletUnionR"(tZipInfo(tDistribution(tScheme(tNamedTemporaryFileResultt
RecordPathtFilecB@s#eZdZdZdZd�ZRS(cC@sdS(N((tself((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pytsave`sN(t__name__t
__module__tNonetsrc_record_patht	dest_pathtchangedR9(((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pyR7[siicC@sMt||�\}}dt|j��jd�jd�}|t|�fS(s?Return (encoded_digest, length) for path using hashlib.sha256()ssha256=tlatin1t=(RRtdigesttdecodetrstriptstr(tpatht	blocksizethtlengthRB((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pytrehashhs
cC@s7tridj|�d6Si|d6dd6dd6SdS(sPReturn keyword arguments to properly open a CSV file
    in the given mode.
    s{}btmodettnewlinesutf-8tencodingN(Rtformat(RK((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pyt
csv_io_kwargssscC@s�t|d��d}|j�}|jd�s1tStjjtj��}d|tj	jd�}|j
�}WdQXt|d��!}|j|�|j|�WdQXtS(sQReplace #!python with #!/path/to/python
    Return True if file was changed.
    trbs#!pythons#!tasciiNtwb(
topentreadlinet
startswithtFalsetsyst
executabletencodetgetfilesystemencodingtostlineseptreadtwritetTrue(RFtscriptt	firstlinetexenametrest((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pyt
fix_script~s
cC@s|jdd�j�dkS(NsRoot-Is-PurelibRLttrue(tgettlower(tmetadata((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pytwheel_root_is_purelib�sc@s�y"|jd�}|jd�}Wntk
r<iifSXd��t�fd�|j�D��}t�fd�|j�D��}||fS(Ntconsole_scriptstgui_scriptscS@s3t|�jdd�jd�}|d|dfS(s[get the string representation of EntryPoint,
        remove space and split on '='
        t RLRAii(RERtsplit(tstsplit_parts((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pyt	_split_ep�s!c3@s|]}�|�VqdS(N((t.0tv(Rq(sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pys	<genexpr>�sc3@s|]}�|�VqdS(N((RrRs(Rq(sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pys	<genexpr>�s(t
get_entry_maptKeyErrortdicttvalues(tdistributiontconsoletgui((RqsW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pytget_entrypoints�s
		""c@s2|s
dStjt�}xC|D];}tjj|�}tjj|�}||j|�q Wgtj	j
dd�jtj�D]$}tjj
|�jtj�^q���jtjj
tjjtj����fd�|j�D�}|s�dSg}x�|j�D]�\}}t|�}	t|	�dkrLdj|	d�}
n(djdj|	d	 �d
|	d	�}
|jdj|
|��qWd}t|�dkr�|j|jd
��n|j|jd��td�tj	j
dd�jtj�D��}|r%d}
|j|
�ndj|�S(s�Determine if any scripts are not on PATH and format a warning.
    Returns a warning message if one or more scripts are not on PATH,
    otherwise None.
    tPATHRLc@s7i|]-\}}tjj|��kr||�qS((R\RFtnormcase(Rrt
parent_dirtscripts(t
not_warn_dirs(sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pys
<dictcomp>�s		isscript {} isisscripts {} ares, i����s and s.The {} installed in '{}' which is not on PATH.seConsider adding {} to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.sthis directorysthese directoriescs@s%|]}|r|ddkVqdS(it~N((Rrti((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pys	<genexpr>�ssiNOTE: The current PATH contains path(s) starting with `~`, which may not be expanded by all applications.s
N(R<tcollectionstdefaultdicttsetR\RFtdirnametbasenametaddtenvironRgRntpathsepR}RDtseptappendRXRYtitemstsortedtlenROtjointany(Rtgrouped_by_dirtdestfileR~tscript_nameR�twarn_fort	msg_linestdir_scriptstsorted_scriptst
start_textt
last_line_fmttwarn_for_tildettilde_warning_msg((R�sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pyt!message_about_scripts_not_on_PATH�sB
I(".cC@std�|D��S(s�Normalize the given rows of a RECORD file.

    Items in each row are converted into str. Rows are then sorted to make
    the value more predictable for tests.

    Each row is a 3-tuple (path, hash, size) and corresponds to a record of
    a RECORD file (see PEP 376 and PEP 427 for details).  For the rows
    passed to this function, the size can be an integer as an int or string,
    or the empty string.
    cs@s9|]/\}}}t|dd�|t|�fVqdS(RNsutf-8N(R	RE(Rrtrecord_paththash_tsize((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pys	<genexpr>
s(R�(toutrows((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pyt_normalized_outrows�scC@s|S(N((R�((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pyt_record_to_fs_pathscC@s�|dk	r_tjj|�dj�tjj|�dj�kr_tjj||�}q_n|jtjjd�}td|�S(Nit/R6(	R<R\RFt
splitdriveRhtrelpathRR�R"(RFtrelative_to((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pyt_fs_to_record_pathscC@st|dd�}td|�S(NRNsutf-8R6(R
R"(t
record_columntp((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pyt_parse_record_path#scC@sXg}x�|D]�}t|�dkr8tjd|�nt|d�}|j||�}||kr�tt|��\}	}
nDt|�dkr�|dnd}	t|�dkr�|dnd}
|j||	|
f�q
WxE|D]=}t||�}t|�\}	}
|j||	|
f�q�Wx*t	|�D]}
|j|
ddf�q4W|S(s_
    :param installed: A map from archive RECORD path to installation RECORD
        path.
    is,RECORD line has more than three elements: %siiRLi(
R�tloggertwarningR�tpopRJR�R�R�R(told_csv_rowst	installedR?t	generatedtlib_dirtinstalled_rowstrowtold_record_pathtnew_record_pathRBRItfRFtinstalled_record_path((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pytget_csv_rows_for_installed)s$
""
cC@s�|j�}g}|jdd�}|r�dtjkrM|jd|�ntjjdd�dkr�|jdjtj	d|��n|jdjt
�|��g|D]}tjd|�r�|^q�}x|D]
}||=q�Wn|jd	d�}|r�dtjkr(|jd
|�n|jdjt
�|��g|D]}tjd|�rK|^qK}x|D]
}||=qvWn|j
td
j|j���|S(sk
    Given the mapping from entrypoint name to callable, return the relevant
    console script specs.
    tpiptENSUREPIP_OPTIONSspip = RLt
altinstalls
pip{} = {}ispip(\d(\.\d)?)?$teasy_installseasy_install = seasy_install-{} = {}seasy_install(-\d\.\d)?$s{} = {}N(tcopyR�R<R\R�R�RgRORXtversion_infoRtretmatchtextendRR�(Rytscripts_to_generatet
pip_scripttktpip_epteasy_install_scriptteasy_install_ep((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pytget_console_script_specsJs6#+
+
t
ZipBackedFilecB@s#eZd�Zd�Zd�ZRS(cC@s(||_||_||_t|_dS(N(R=R>t	_zip_fileRWR?(R8R=R>tzip_file((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pyt__init__�s			cC@s5ts|jj|j�S|jj|jjd��S(Nsutf-8(RR�tgetinfoR=RZ(R8((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pyt_getinfo�scC@s�tjj|j�}t|�tjj|j�rGtj|j�n|j�}|jj	|��2}t	|jd��}t
j||�WdQXWdQXt|�r�t
|j�ndS(NRS(R\RFR�R>RtexiststunlinkR�R�RTtshutiltcopyfileobjRR(R8R~tzipinfoR�tdest((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pyR9�s

(R:R;R�R�R9(((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pyR��s			t
ScriptFilecB@seZd�Zd�ZRS(cC@s4||_|jj|_|jj|_t|_dS(N(t_fileR=R>RWR?(R8tfile((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pyR��s	cC@s#|jj�t|j�|_dS(N(R�R9ReR>R?(R8((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pyR9�s
(R:R;R�R9(((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pyR��s	tMissingCallableSuffixcB@seZd�ZRS(cC@s#tt|�jdj|��dS(Ns�Invalid script entry point: {} - A callable suffix is required. Cf https://packaging.python.org/specifications/entry-points/#use-for-scripts for more information.(tsuperR�R�RO(R8tentry_point((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pyR��s(R:R;R�(((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pyR��scC@s@t|�}|dk	r<|jdkr<tt|���ndS(N(RR<tsuffixR�RE(t
specificationtentry((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pyt_raise_for_invalid_entrypoint�stPipScriptMakercB@seZdd�ZRS(cC@s#t|�tt|�j||�S(N(R�R�R�tmake(R8R�toptions((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pyR��s
N(R:R;R<R�(((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pyR��sc:@s�t�|�\}}	t|	�r-|j�n	|j�i�t��g}
t���fd�}�fd�}d�}
�fd���fd�}��fd�}d�}|�}t|
|�}t||�\}}|�t�dt	j
���}t||�}d	�}t||�\}}|�|�}t||�}t||�}t
�|��}t|�\����fd
�}t||�}t||�}tt|�}t||�}x1|D])}|j�||j|j|j�q�W��fd�} d�}!|r�t���}"tj���tjd
�x�| �D]|}#t|#dt	j
��}$tj|$dtdt�}%|%rS|!|#�}&td|&jtjj d��}'||'|&�qSqSWWdQXWdQXt!j"|"j#��nt$d|j&�}(t|(_'dh|(_(t|(_)t*��})t+t,dj-�j.���}*|(j/|)�}+|
j0|+�|
j0|(j/|*itd6��|r�t1|+�},|,dk	r�t!j2|,�q�ndt3�@�t4j5�fd��}-tjj6�|�}.tjj6|.d�}/|-|/��}0|0j7d�WdQX|
j8|/�|dk	r�tjj6|.t9�}1|-|1��#}2|2j7|j:�j;d��WdQX|
j8|1�n|r�tjj6|.d�}3t<|3d��WdQX|
j8|3�n|j=d�}4t+t>j?|4j@���}5tA|5d�d�d |
d!��}6tjj6|.d�}7|-|7tBd���2}8t>jCtd"|8��}9|9jDtE|6��WdQXdS(#s�Install a wheel.

    :param name: Name of the project to install
    :param wheel_zip: open ZipFile for wheel being installed
    :param scheme: Distutils scheme dictating the install directories
    :param req_description: String used in place of the requirement, for
        logging
    :param pycompile: Whether to byte-compile installed Python files
    :param warn_script_location: Whether to check that scripts are installed
        into a directory on PATH
    :raises UnsupportedWheel:
        * when the directory holds an unpacked wheel with incompatible
          Wheel-Version
        * when the .dist-info dir does not match the wheel
    c@s9t|��}|�|<|r5�jt|��ndS(s6Map archive RECORD paths to installation RECORD paths.N(R�R�(tsrcfileR�tmodifiedtnewpath(R?R�R�(sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pytrecord_installeds
c3@s>�j�}tt|�}x|D]}td|�Vq"WdS(NR6(tnamelistRR
R"(tnamest
decoded_namestname(t	wheel_zip(sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pyt	all_paths&s
cS@s
|jd�S(NR�(tendswith(RF((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pytis_dir_path/sc@s7t||�s3d}t|j�||���ndS(NsRThe wheel {!r} has a file {!r} trying to install outside the target directory {!r}(RRRO(t
dest_dir_pathttarget_pathtmessage(t
wheel_path(sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pytassert_no_path_traversal3sc@s���fd�}|S(Nc@sDtjj|�}tjj�|�}��|�t||��S(N(R\RFtnormpathR�R�(R�tnormed_pathR>(R�R�R�(sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pytmake_root_scheme_file@s
((R�R�R�(R�(R�R�sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pytroot_scheme_file_maker>sc@sdi�x?tD]7}t|�}tt||�dtj���|<q
W����fd�}|S(NRNc	@s�tjj|�}y%|jtjjd�\}}}Wn/tk
rhdj�|�}t|��nXy�|}WnJtk
r�dj	t
���}dj�|||�}t|��nXtjj	||�}�||�t||��S(NisbUnexpected file in {}: {!r}. .data directory contents should be named like: '<scheme key>/<path>'.s, s�Unknown scheme key used in {}: {} (for file {!r}). .data directory contents should be in subdirectories named with a valid scheme key ({})(R\RFR�RnR�t
ValueErrorRORRuR�R�R�(	R�R�t_t
scheme_keytdest_subpathR�tscheme_pathtvalid_scheme_keysR>(R�tscheme_pathsR�R�(sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pytmake_data_scheme_fileRs"%


(RR
tgetattrRXR[(R�tschemetkeytencoded_keyR�(R�R�(R�R�sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pytdata_scheme_file_makerIs
&cS@s|jdd�djd�S(NR�iis.data(RnR�(RF((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pytis_data_scheme_pathqsRNcS@sE|jdd�}t|�dkoD|djd�oD|ddkS(NR�iis.dataiR(RnR�R�(RFtparts((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pytis_script_scheme_path�sc@s�|j}tjj|�}|j�jd�r=|d }nJ|j�jd�r_|d }n(|j�jd�r�|d }n|}|�kp�|�kS(Ns.exei����s
-script.pyi����s.pya(R>R\RFR�RhR�(R�RFR�t	matchname(RyRz(sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pytis_entrypoint_wrapper�s	


c3@snxgtt�j���D]M}tjj�|�}tjj|�sLqn|jd�saqn|VqWdS(Ns.py(R�R�RwR\RFR�tisfileR�(tinstalled_pathtfull_installed_path(R�R�(sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pytpyc_source_file_paths�scS@s9tr%tjjr|dS|dSntjj|�SdS(sAReturn the path the pyc file would have been written to.
        totcN(RRXtflagstoptimizet	importlibtutiltcache_from_source(RF((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pytpyc_output_path�s
tignoretforcetquietR6R�NRLs{} = {}Rzi�c;@sDt||��}|VWdQXtj|j��t|j|�dS(N(RR\tchmodR�R(RFtkwargsR�(tgenerated_file_mode(sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pyt_generate_filest	INSTALLERspip
sutf-8t	REQUESTEDtwtRECORDR�R?R�R�sIO[str](FR RjtpurelibtplatlibR�RWRRR
RXR[RRR!R{R�R9R=R>R?Rtwarningstcatch_warningstfilterwarningsR	t
compilealltcompile_fileR`R"RR\RFR�R�tdebugtgetvalueR�R<Rtclobbertvariantstset_modeR�tlistRROR�t
make_multipleR�R�R�Rt
contextlibtcontextmanagerR�R_R�Rtto_jsonRZRTtget_metadatatcsvtreadert
splitlinesR�RPtwritert	writerowsR�(:R�R�R�Rt	pycompiletwarn_script_locationt
direct_urlt	requestedtinfo_dirRiR�R�R�R�R�RRtpathst
file_pathstroot_scheme_pathstdata_scheme_pathsR�tfilesRtother_scheme_pathstscript_scheme_pathsR�tother_scheme_filesRxR	tscript_scheme_filesR�R
RtstdoutRFtpath_argtsuccesstpyc_pathtpyc_record_pathtmakerR�tgui_scripts_to_generatetgenerated_console_scriptstmsgRt
dest_info_dirtinstaller_pathtinstaller_filetdirect_url_pathtdirect_url_filetrequested_pathtrecord_texttrecord_rowstrowsR�trecord_fileR6((	R�R?RyRRzR�R�R�R�sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pyt_install_wheel�s�				(				

	


 		

"	cc@s\y	dVWnLtk
rW}dj||jd�}ttt|�tj�d�nXdS(NsFor req: {}. {}ii(RROtargsRRXtexc_info(treq_descriptionteR�((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pytreq_error_context;s	c	C@sit|dt��Q}t|��<td|d|d|d|d|d|d|d	|�WdQXWdQXdS(
Nt
allowZip64R�R�R�RR8R9R:R;(RR`R^RY(	R�R�RR\R8R9R:R;tz((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pyt
install_wheelGs
(yt__doc__t
__future__RR�R&R/R3Rtloggingtos.pathR\R�R�RXR#tbase64Rt	itertoolsRRtzipfileRtpip._vendorRtpip._vendor.distlib.scriptsRtpip._vendor.distlib.utilRtpip._vendor.sixRR	R
RRR
tpip._vendor.six.movesRRtpip._internal.exceptionsRtpip._internal.locationsRtpip._internal.models.direct_urlRRtpip._internal.models.schemeRtpip._internal.utils.filesystemRRtpip._internal.utils.miscRRRRtpip._internal.utils.typingRtpip._internal.utils.unpackingRRRRtpip._internal.utils.wheelR R!R"t
email.messageR#ttypingR$R%R&R'R(R)R*R+R,R-R.R/R0R1R2tpip._vendor.pkg_resourcesR3R4R5R6REtinttInstalledCSVRowR7t	getLoggerR:R�RJRPReRjR{R�R�R�R<R�R�R�R�tobjectR�R�R�R�R�R`RWRYR0R^Ra(((sW/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/install/wheel.pyt<module>s�.""d
					G				!	V.	�?

Zerion Mini Shell 1.0