Viewing File: /opt/alt/python35/lib64/python3.5/__pycache__/compileall.cpython-35.opt-2.pyc



]-@s8ddlZddlZddlZddlZddlZyddlmZWnek
rjdZYnXddl	m
Z
dddgZddddd	Zddd
ddd
ddddZ
dd
ddd
dd
dZddd
dd
dddZddZedkr4eeZejedS)N)ProcessPoolExecutor)partialcompile_dircompile_filecompile_path
ccsa|stdj|ytj|}Wn7tk
re|dkr[tdj|g}YnX|jx|D]}|dkrqwtjj||}|dk	rtjj||}nd}tjj|s|Vqw|dkrw|tj	krw|tj
krwtjj|rwtjj|rwt|d|d|dd	|EdHqwWdS)
NzListing {!r}...zCan't list {!r}__pycache__rddir	maxlevelsquiet)
printformatoslistdirOSErrorsortpathjoinisdircurdirpardirislink	_walk_dir)dirr
rr
namesnamefullnamedfiler //opt/alt/python35/lib64/python3.5/compileall.pyrs,


*%rFrc	Cs|dk	r$|dkr$tdt|d|d|d|}	d}
|dk	r|dkrtdk	r|pud}td|U}|jttd|d|d	|d|d
|d||	}t|dd}
WdQRXn5x2|	D]*}
t|
||||||sd}
qW|
S)
Nrz%workers must be greater or equal to 0r
rr
rmax_workersforcerxlegacyoptimizedefault)
ValueErrorrrmaprrmin)rrr
r#r$r
r%r&workersfilessuccessexecutorresultsfiler r r!r4s(	$	

cCs'd}tjj|}|dk	r<tjj||}	nd}	|dk	rg|j|}
|
rg|Stjj|r#|r|d}nc|dkr|dkr|nd}tjj|d|}ntjj|}tjj	|}
|dd|dd}}|dkr#|syot
tj|j}t
jdtjj|}t|d	}|jd
}WdQRX||kr|SWntk
rYnX|stdj|y"tj|||	dd
|}Wn-tjk
r}zd}|dkr|S|r+tdj|ntddd|jjtjjdd}|jtjj}t|WYdd}~Xntttfk
r}z^d}|dkr|S|rtdj|ntdddt|j j!d|WYdd}~XnX|dkr#d}|S)Nrcroptimizationz.pyz<4slrbzCompiling {!r}...Tr&rz*** Error compiling {!r}...z*** enderrorsbackslashreplace:r;)"rrbasenamersearchisfile	importlibutilcache_from_sourcedirnameintstatst_mtimestructpackMAGIC_NUMBERopenreadrrr
py_compilecompilePyCompileErrormsgencodesysstdoutencodingdecodeSyntaxErrorUnicodeError	__class____name__)rr
r#r$r
r%r&r-rrmocfileopt	cache_dirheadtailmtimeexpectchandleactualokerrrNer r r!r\st
	!	

	*cCsd}xstjD]h}|s,|tjkrK|rK|dkrxtdq|out||d|d|d|d|}qW|S)NrrzSkipping current directoryr
r%r&)rPrrrrr)skip_curdirrr#r
r%r&r-rr r r!rs

c
Csddl}|jdd}|jddddddd	d
ddd
|jddtd
ddd|jdddd
ddd|jdddd
ddddd|jdddd
ddd|jdddd
d dddd!|jd"dd#d
d$dddd%|jd&dd'd
d(dd)|jd*dd+d,d-dd.|jd/d0dd1dtdd2|j}|j}|jrddl}|j|j|_|j	dk	r|j	}n	|j
}|jrxyY|jd3krtj
nt|j+}x!|D]}|j|jqWWdQRXWn;tk
rw|jd4krotd5j|jd6SYnX|jdk	r|jpd|_d7}y|r>x|D]}	tjj|	rt|	|j|j|j|j|js6d6}qt|	||j|j|j|j|jd8|jsd6}qW|Std|jd|jd|jSWn/tk
r|jd4krtd9d6SYnXd7S):Nrdescriptionz1Utilities to support installing Python libraries.z-lactionstore_constconstr'rdestrhelpz!don't recurse into subdirectoriesz-rtype	recursionzhcontrol the maximum recursion level. if `-l` and `-r` options are specified, then `-r` takes precedence.z-f
store_truer#z/force rebuild even if timestamps are up to datez-qcountr
zIoutput only error messages; -qq will suppress the error messages as well.z-br%z0use legacy (pre-PEP3147) compiled file locationsz-dmetavarDESTDIRr
zdirectory to prepend to file paths for use in compile-time tracebacks and in runtime tracebacks in cases where the source file is unavailablez-xREGEXPr$zskip files matching the regular expression; the regexp is searched for in the full path of each file considered for compilationz-iFILEflistzzadd all the files and directories listed in FILE to the list considered for compilation; if "-", names are read from stdincompile_destzFILE|DIRnargs*zrzero or more file and directory names to compile; if no arguments given, defaults to the equivalent of -l sys.pathz-jz	--workersrzRun compileall concurrently-rzError reading file list {}FTr+z
[interrupted]) argparseArgumentParseradd_argumentrC
parse_argsrur$rerLrmrrtrPstdinrIappendstriprr
rrr+rrr>rr
r#r%rrKeyboardInterrupt)
ryparserargs
compile_destsr}rfliner-rjr r r!mains~		
				*
"
	
	


	r__main__rr)rrPimportlib.utilr?rKrFconcurrent.futuresrImportError	functoolsr__all__rrrrrrWrCexit_statusexitr r r r!<module>
s*
'P[
Back to Directory File Manager