????

Your IP : 216.73.216.152


Current Path : /proc/self/root/proc/self/root/lib/python2.7/site-packages/pip/_vendor/distlib/
Upload File :
Current File : //proc/self/root/proc/self/root/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyc

�
}�\]c@s�ddlmZddlZddlZddlZddlZddlZddlmZm	Z	m
Z
ddlmZddl
mZmZmZmZmZeje�Zdj�Zejd�Zd	Zd
�Zdefd��YZdS(
i����(tBytesIONi(t	sysconfigtdetect_encodingtZipFile(tfinder(tFileOperatortget_export_entrytconvert_pathtget_executabletin_venvs�
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
 <assemblyIdentity version="1.0.0.0"
 processorArchitecture="X86"
 name="%s"
 type="win32"/>

 <!-- Identify the application security requirements. -->
 <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
 <security>
 <requestedPrivileges>
 <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
 </requestedPrivileges>
 </security>
 </trustInfo>
</assembly>s^#!.*pythonw?[0-9.]*([ 	].*)?$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())
cCs�d|kr�|jd�re|jdd�\}}d|kr�|jd�r�d||f}q�q�|jd�s�d|}q�n|S(Nt s
/usr/bin/env it"s%s "%s"s"%s"(t
startswithtsplit(t
executabletenvt_executable((s:/tmp/pip-install-ewDPok/pip/pip/_vendor/distlib/scripts.pyt_enquote_executable3stScriptMakercBseZdZeZdZeedd�Z	d�Z
ejj
d�rZd�Zd�Znd�Zddd�Zd	�ZeZd
�Zd�Zdd�Zd
�Zed��Zejd��Zejdks�ejdkrejdkrd�Zndd�Z dd�Z!RS(s_
    A class to copy or create scripts from source scripts or callable
    specifications.
    cCs�||_||_||_t|_t|_tjdkpWtjdkoWtjdk|_	t
d�|_|p{t|�|_
tjdkp�tjdko�tjdk|_dS(NtposixtjavatsX.Ytnt(RsX.Y(t
source_dirt
target_dirt
add_launcherstFalsetforcetclobbertostnamet_nametset_modetsettvariantsRt_fileopt_is_nt(tselfRRRtdry_runtfileop((s:/tmp/pip-install-ewDPok/pip/pip/_vendor/distlib/scripts.pyt__init__Ls					cCsa|jdt�r]|jr]tjj|�\}}|jdd�}tjj||�}n|S(Ntguitpythontpythonw(tgetRR$RtpathR
treplacetjoin(R%Rtoptionstdntfn((s:/tmp/pip-install-ewDPok/pip/pip/_vendor/distlib/scripts.pyt_get_alternate_executable\s
RcCs[y,t|��}|jd�dkSWdQXWn(ttfk
rVtjd|�tSXdS(sl
            Determine if the specified executable is a script
            (contains a #! line)
            is#!NsFailed to open %s(topentreadtOSErrortIOErrortloggertwarningR(R%Rtfp((s:/tmp/pip-install-ewDPok/pip/pip/_vendor/distlib/scripts.pyt	_is_shelldscCs^|j|�r=ddl}|jjjd�dkrV|Sn|j�jd�rV|Sd|S(Ni����sos.nametLinuxs
jython.exes/usr/bin/env %s(R;RtlangtSystemtgetPropertytlowertendswith(R%RR((s:/tmp/pip-install-ewDPok/pip/pip/_vendor/distlib/scripts.pyt_fix_jython_executablepscCs�tjdkrt}nPt|�t|�d}tjdkrJd}nd}d|koe||k}|r�d||d}n&d	}|d
||d7}|d7}|S(
s
        Build a shebang line. In the simple case (on Windows, or a shebang line
        which is not too long or contains spaces) use a simple formulation for
        the shebang. Otherwise, use /bin/sh as the executable, with a contrived
        shebang which allows the script to run either under Python or sh, using
        suitable quoting. Thanks to Harald Nordgren for his input.

        See also: http://www.in-ulm.de/~mascheck/various/shebang/#length
                  https://hg.mozilla.org/mozilla-central/file/tip/mach
        RitdarwiniiR
s#!s
s
#!/bin/sh
s	'''exec' s "$0" "$@"
s' '''(RRtTruetlentsystplatform(R%Rtpost_interptsimple_shebangtshebang_lengthtmax_shebang_lengthtresult((s:/tmp/pip-install-ewDPok/pip/pip/_vendor/distlib/scripts.pyt_build_shebang|s		
RcCs�t}|jr!|j}t}n�tj�s9t�}nqt�rptjj	tj
d�dtjd��}n:tjj	tjd�dtjd�tjd�f�}|r�|j||�}nt
jjd�r�|j|�}ntjj|�}|rt|�}n|jd�}t
jd	krSd
|krSd|krS|d7}n|j||�}y|jd�Wn!tk
r�td
|��nX|dkr�y|j|�Wq�tk
r�td||f��q�Xn|S(Ntscriptsspython%stEXEtBINDIRs
python%s%stVERSIONRsutf-8tclis	-X:Framess
-X:FullFramess
 -X:Framess,The shebang (%r) is not decodable from utf-8s?The shebang (%r) is not decodable from the script encoding (%r)(RDRRRtis_python_buildRR	RR-R/tget_pathtget_config_varR3RFRGRRBtnormcaseRtencodeRMtdecodetUnicodeDecodeErrort
ValueError(R%tencodingRHR0tenquoteRtshebang((s:/tmp/pip-install-ewDPok/pip/pip/_vendor/distlib/scripts.pyt_get_shebang�sL					


cCs6|jtd|jd|jjd�dd|j�S(Ntmoduletimport_namet.itfunc(tscript_templatetdicttprefixtsuffixR
(R%tentry((s:/tmp/pip-install-ewDPok/pip/pip/_vendor/distlib/scripts.pyt_get_script_text�scCstjj|�}|j|S(N(RR-tbasenametmanifest(R%texenametbase((s:/tmp/pip-install-ewDPok/pip/pip/_vendor/distlib/scripts.pytget_manifest�scCs�|jo|j}tjjd�}|j|�s@||7}n|sS||}nx|dkrq|jd�}n|jd�}t�}	t|	d��}
|
j	d|�WdQX|	j
�}|||}x�|D]�}tjj|j
|�}
|r�tjj|
�\}}|jd�r&|}
nd|
}
y|jj|
|�Wq�tk
r�tjd�d	|
}tjj|�r�tj|�ntj|
|�|jj|
|�tjd
�ytj|�Wq�tk
r�q�Xq�Xn�|jr|
jd|�rd|
|f}
ntjj|
�rN|jrNtjd
|
�q�n|jj|
|�|jr�|jj|
g�n|j|
�q�WdS(Nsutf-8tpytttws__main__.pys.pys%s.exes:Failed to write executable - trying to use .deleteme logics%s.deletemes0Able to replace executable using .deleteme logicRas%s.%ssSkipping existing file %s(RR$RtlinesepRWRAt
_get_launcherRRtwritestrtgetvalueR-R/RtsplitextRR#twrite_binary_filet	ExceptionR8R9texiststremovetrenametdebugRR tset_executable_modetappend(R%tnamesR]tscript_bytest	filenamestexttuse_launcherRqtlaunchertstreamtzftzip_dataRtoutnametntetdfname((s:/tmp/pip-install-ewDPok/pip/pip/_vendor/distlib/scripts.pyt
_write_script�sX

	
	





	cCsQd}|rL|jdg�}|rLddj|�}|jd�}qLn|jd|d|�}|j|�jd�}|j}t�}	d|jkr�|	j|�nd|jkr�|	jd|t	j
d	f�nd
|jkr
|	jd|t	j
d f�n|r.|jd
t�r.d}
nd}
|j|	||||
�dS(NRtinterpreter_argss %sR
sutf-8R0tXs%s%sisX.Ys%s-%siR)tpywRn(
R,R/RWR^RhRR!R"taddRFtversionRR�(R%RgR�R0RHtargsR]tscriptRtscriptnamesR�((s:/tmp/pip-install-ewDPok/pip/pip/_vendor/distlib/scripts.pyt_make_scripts(		!!	cCs@t}tjj|jt|��}tjj|jtjj|��}|jr||j	j
||�r|tjd|�dSyt
|d�}Wn&tk
r�|js��nd}noX|j�}|s�tjd|j�|�dStj|jdd��}|r&t}|jd�p d}n|s�|r?|j�n|j	j||�|jrq|j	j|g�n|j|�n�tjd||j�|j	js)t|j�\}	}
|j d	�|j!|	|�}d
|kr�d}nd}tjj|�}
|j"|
g||j#�||�n|r<|j�ndS(
Nsnot copying %s (up-to-date)trbs"%s: %s is an empty file (skipping)s
s
iRscopying and adjusting %s -> %siR+R�Rn($RRR-R/RRRRiRR#tnewerR8R{R4R7R&tNonetreadlineR9tget_command_namet
FIRST_LINE_REtmatchR.RDtgrouptcloset	copy_fileR R|R}tinfoRtseekR^R�R5(R%R�R�tadjustR�tft
first_lineR�RHR[tlinesR]R�R�((s:/tmp/pip-install-ewDPok/pip/pip/_vendor/distlib/scripts.pyt_copy_script)sR$ 
	
	
	

	%cCs
|jjS(N(R#R&(R%((s:/tmp/pip-install-ewDPok/pip/pip/_vendor/distlib/scripts.pyR&]scCs||j_dS(N(R#R&(R%tvalue((s:/tmp/pip-install-ewDPok/pip/pip/_vendor/distlib/scripts.pyR&asRcCsftjd�dkrd}nd}d||f}tjdd�d}t|�j|�j}|S(	NtPit64t32s%s%s.exeRaii(tstructtcalcsizet__name__trsplitRtfindtbytes(R%tkindtbitsRtdistlib_packageRL((s:/tmp/pip-install-ewDPok/pip/pip/_vendor/distlib/scripts.pyRris	cCsKg}t|�}|dkr1|j||�n|j||d|�|S(s�
        Make a script.

        :param specification: The specification, which is either a valid export
                              entry specification (to make a script from a
                              callable) or a filename (to make a script by
                              copying from a source location).
        :param options: A dictionary of options controlling script generation.
        :return: A list of all absolute pathnames written to.
        R0N(RR�R�R�(R%t
specificationR0R�Rg((s:/tmp/pip-install-ewDPok/pip/pip/_vendor/distlib/scripts.pytmakewscCs4g}x'|D]}|j|j||��q
W|S(s�
        Take a list of specifications and make scripts from them,
        :param specifications: A list of specifications.
        :return: A list of all absolute pathnames written to,
        (textendR�(R%tspecificationsR0R�R�((s:/tmp/pip-install-ewDPok/pip/pip/_vendor/distlib/scripts.pyt
make_multiple�s
N("R�t
__module__t__doc__tSCRIPT_TEMPLATERcR�RRDRR(R3RFRGRR;RBRMR^Rht_DEFAULT_MANIFESTRjRmR�R�R�tpropertyR&tsetterRRRRrR�R�(((s:/tmp/pip-install-ewDPok/pip/pip/_vendor/distlib/scripts.pyRCs.			8			4	4-(tioRtloggingRtreR�RFtcompatRRRt	resourcesRtutilRRRRR	t	getLoggerR�R8tstripR�tcompileR�R�RtobjectR(((s:/tmp/pip-install-ewDPok/pip/pip/_vendor/distlib/scripts.pyt<module>s(