MINI MINI MANI MO

Path : /usr/lib64/python3.6/__pycache__/
File Upload :
Current File : //usr/lib64/python3.6/__pycache__/compileall.cpython-36.pyc

3


 \]/@sdZddlZddlZddlZddlZddlZddlmZdddgZ	ddd	Z
dddZdd
dZdddZ
ddZedkreeZejedS)aModule/script to byte-compile all .py files to .pyc files.

When called as a script with arguments, this compiles the directories
given as arguments recursively; the -l option prevents it from
recursing into directories.

Without arguments, if compiles all modules on sys.path, without
recursing into subdirectories.  (Even though it should do so for
packages -- for now, you'll have to deal with packages separately.)

See module py_compile for details of the actual byte-compilation.
N)partialcompile_dircompile_filecompile_path
ccs |dkrt|tjrtj|}|s0tdj|ytj|}Wn.tk
rl|dkrdtdj|g}YnX|jx|D]}|dkrq|tj	j
||}|dk	rtj	j
||}nd}tj	j|s|Vq||dkr||tjkr||tj
kr|tj	j|r|tj	j|r|t|||d|dEdHq|WdS)NzListing {!r}...zCan't list {!r}__pycache__r)ddir	maxlevelsquiet)
isinstanceosPathLikefspathprintformatlistdirOSErrorsortpathjoinisdircurdirpardirislink	_walk_dir)dirr
rrnamesnamefullnamedfiler""/usr/lib64/python3.6/compileall.pyrs0


rFr	c	Csd}	|dk	rP|dkrtdn2|dkrPyddlm}	Wntk
rNd}YnXt||||d}
d}|dk	r|dkr|	dk	r|pd}|	|d0}|jtt||||||d	|
}
t|
dd
}WdQRXn&x$|
D]}t|||||||sd}qW|S)aByte-compile all modules in the given directory tree.

    Arguments (only dir is required):

    dir:       the directory to byte-compile
    maxlevels: maximum recursion level (default 10)
    ddir:      the directory that will be prepended to the path to the
               file as it is compiled into each byte-code file.
    force:     if True, force compilation, even if timestamps are up-to-date
    quiet:     full output with False or 0, errors only with 1,
               no output with 2
    legacy:    if True, produce legacy pyc paths instead of PEP 3147 paths
    optimize:  optimization level or -1 for level of the interpreter
    workers:   maximum number of parallel workers
    Nrz%workers must be greater or equal to 0r	)ProcessPoolExecutor)rrr
T)Zmax_workers)r
forcerxrlegacyoptimize)defaultF)	
ValueErrorZconcurrent.futuresr$ImportErrorrmaprrmin)rrr
r%r&rr'r(workersr$filessuccessZexecutorZresultsfiler"r"r#r2s6


cCsd}|dkr"t|tjr"tj|}tjj|}|dk	rFtjj||}	nd}	|dk	rd|j|}
|
rd|Stjj|r|r|d}nB|dkr|dkr|nd}t	j
j||d}nt	j
j|}tjj|}
|dd|dd}}|d
kr|sXyTt
tj|j}tjdt	j
j|}t|d}|jd
}WdQRX||kr>|SWntk
rVYnX|sltdj|ytj|||	d|d}Wntjk
r}zdd}|dkr|S|rtdj|ntddd|jjtjjdd}|j tjj}t|WYdd}~Xn~t!t"tfk
rv}zLd}|dkr2|S|rHtdj|ntdddt|j#j$d|WYdd}~XnX|dkrd}|S)aByte-compile one file.

    Arguments (only fullname is required):

    fullname:  the file to byte-compile
    ddir:      if given, the directory name compiled in to the
               byte-code file.
    force:     if True, force compilation, even if timestamps are up-to-date
    quiet:     full output with False or 0, errors only with 1,
               no output with 2
    legacy:    if True, produce legacy pyc paths instead of PEP 3147 paths
    optimize:  optimization level or -1 for level of the interpreter
    TrNcrr	)optimizationz.pyz<4slrbzCompiling {!r}...)r(Fz*** Error compiling {!r}...z*** )endbackslashreplace)errors:r<)%r
rrrrbasenamersearchisfile	importlibutilcache_from_sourcedirnameintstatst_mtimestructZpackMAGIC_NUMBERopenreadrrr
py_compilecompilePyCompileErrormsgencodesysstdoutencodingdecodeSyntaxErrorUnicodeError	__class____name__)r r
r%r&rr'r(r0rr!ZmocfileoptZ	cache_dirheadtailmtimeZexpectZchandleZactualokerrrNer"r"r#rbsx






$
c
CsXd}xNtjD]D}|s |tjkr6|r6|dkrPtdq|oNt||d||||d}qW|S)awByte-compile all module on sys.path.

    Arguments (all optional):

    skip_curdir: if true, skip current directory (default True)
    maxlevels:   max recursion level (default 0)
    force: as for compile_dir() (default False)
    quiet: as for compile_dir() (default 0)
    legacy: as for compile_dir() (default False)
    optimize: as for compile_dir() (default -1)
    TrzSkipping current directoryN)rr'r()rPrrrrr)Zskip_curdirrr%rr'r(r0rr"r"r#rs

c
Cszddl}|jdd}|jdddddd	d
|jdtdd
d|jddddd|jdddddd|jddddd|jdddddd |jd!d"d#dd$d |jd%d&d'd(d)|jd*d+d,d-d.|jd/d0d1td2d3|j}|j}|jrddl}|j|j|_|j	dk	r|j	}n|j
}|jryJ|jd4kr4tj
nt|j$}x|D]}|j|jqFWWdQRXWn2tk
r|jd5krtd6j|jd7SX|jdk	r|jpd|_d8}y|r4xj|D]b}	tjj|	rt|	|j|j|j|j|js*d7}n*t|	||j|j|j|j|j|jd9sd7}qW|St|j|j|jd:SWn*tk
rt|jd5krptd;d7SXd8S)<zScript main program.rNz1Utilities to support installing Python libraries.)Zdescriptionz-lZstore_constrrz!don't recurse into subdirectories)actionZconstr)desthelpz-r	recursionzhcontrol the maximum recursion level. if `-l` and `-r` options are specified, then `-r` takes precedence.)typerarbz-f
store_truer%z/force rebuild even if timestamps are up to date)r`rarbz-qcountrzIoutput only error messages; -qq will suppress the error messages as well.)r`rar)rbz-br'z0use legacy (pre-PEP3147) compiled file locationsz-dZDESTDIRr
zdirectory to prepend to file paths for use in compile-time tracebacks and in runtime tracebacks in cases where the source file is unavailable)metavarrar)rbz-xZREGEXPr&zskip files matching the regular expression; the regexp is searched for in the full path of each file considered for compilationz-iZFILEflistzzadd all the files and directories listed in FILE to the list considered for compilation; if "-", names are read from stdin)rgrarbcompile_destzFILE|DIR*zrzero or more file and directory names to compile; if no arguments given, defaults to the equivalent of -l sys.path)rgnargsrbz-jz	--workersr	zRun compileall concurrently)r)rdrb-rzError reading file list {}FT)r.)r'r%rz
[interrupted]) argparseArgumentParseradd_argumentrD
parse_argsrir&rerLrcrrhrPstdinrIappendstriprrrrr.rrr?rr
r%r'rrKeyboardInterrupt)
rmparserargsZ
compile_destsrqrfliner0rar"r"r#mains~








"



rz__main__)Nrr)rNFNrFr|r	r|)NFNrFr|r|)r	rFrFr|)__doc__rrPimportlib.utilr@rKrG	functoolsr__all__rrrrrzrWrDZexit_statusexitr"r"r"r#<module>s$


/
R
[

OHA YOOOO