\dOdZddlZddlZddlZddlZddlZddlZddlm Z ddl m Z gdZ ddZ dddddd d Z dddddd d Z dd ZdZedkr&ee ZejedSdS)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, it 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)partial)Path) compile_dir compile_file compile_pathc# K|dkr.t|tjrtj|}|s"t d| tj|}n:#t$r-|dkr"t d|g}YnwxYw||D]}|dkr tj ||}tj |s|VM|dkry|tj kri|tj krYtj |r:tj |st||dz |Ed{VdS)NzListing {!r}...zCan't list {!r} __pycache__r) maxlevelsquiet) isinstanceosPathLikefspathprintformatlistdirOSErrorsortpathjoinisdircurdirpardirislink _walk_dir)dirr r namesnamefullnames 8J:\tools\MySQL Workbench 8.0 CE\python\Lib\compileall.pyrrs qyyZR[11yinn - &&s++,,, 3  199 #**3// 0 0 0 JJLLL . . = 7<<T**w}}X&& .NNNN!mm 1 1dbi6G6GgmmH%%7H.0gnnX.F.F7H Y]',... . . . . . . . . .sA114B('B(Fr stripdir prependdir limit_sl_desthardlink_dupesc Pd}|| | td||} |} d}|dkrtd|dkr*ddlm} |ddlm}n#t $rd}YnwxYw|t j}t|||}d }|dkrp|n|pd}|| 5}| tt||||||| | | | | |}t|d }dddn #1swxYwYn"|D]}t|||||||| | | | | sd} |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 `sys.getrecursionlimit()`) 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: int or list of optimization levels or -1 for level of the interpreter. Multiple levels leads to multiple compiled files each with one optimization level. workers: maximum number of parallel workers invalidation_mode: how the up-to-dateness of the pyc will be checked stripdir: part of path to left-strip from source file path prependdir: path to prepend to beginning of original file path, applied after stripdir limit_sl_dest: ignore symlinks if they are pointing outside of the defined path hardlink_dupes: hardlink duplicated pyc files NPDestination dir (ddir) cannot be used in combination with stripdir or prependdirrz%workers must be greater or equal to 0r )_check_system_limits)ProcessPoolExecutor)r r T) max_workers) ddirforcerxr legacyoptimizeinvalidation_moder%r&r'r()defaultr$F) ValueErrorconcurrent.futures.processr+concurrent.futuresr,NotImplementedErrorsysgetrecursionlimitrmaprrmin)rr r.r/r0r r1r2workersr3r%r&r'r(r,r+filessuccessexecutorresultsfiles r"rr0s/8 X1Z5KGII I  {{@AAA!||CCCCCC ? " " " ? > > > > > >#   GGG )++ c) < < >'0A~~))2C&^==%C>99E,1Jy))%N<>OQQQBqyy^y)3HUQY4G)H";uneLLL;Ie,,,GNE::: ;@77#G/,   A::"NNNNNN*7>>xHHIIII&b)))):.J#2H2J2JgnnX6HnIIPPQYZZc w7 5 5 5A::"NNNNNN*7>>xHHIIII&b))))ak*S0!44444444 5 Nsv1A5N&N< NN NN  N N,+N,BQ//V0> T*V0 BT**V0 V+ V0AV++V0c d}tjD]E}|r|tjkr|r|dkrt d,|ot ||d|||||}F|S)aByte-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) invalidation_mode: as for compiler_dir() Tr zSkipping current directoryN)r r1r2r3)r9rrrrr) skip_curdirr r/r r1r2r3r?rs r"rrsGx sbi''['qyy2333 +!"3 # # #GG Nc ddl}|d}|dddddd |d td d |dddd|ddddd|dddd|ddddd|d d!d"dd#|d$d%d&dd'|d(d)d*dd+|d,d-d.d/0|d1d2d3d45|d6d7d8td9:d;tjD}|d|d?d@tdAdBC|dDdEdFdG0|dHddIdJ|}|j}|j r#ddl }| |j |_ |j dKkrd|_ |j |j }n|j}|jdLg|_t!|jd8kr|jr|dM|j#|j|j|dN|jr |jdOkr t.jnt3|jdPQ5}|D])}||* dddn #1swxYwYnC#t8$r6|jdRkr't=dS|jYdTSwxYw|j r@|j !dOdU"} tj| } nd} dV} |r|D]} tFj$%| rPtM| |j|j'|j |j|j(| |j|j|j|j |jW sdT} qtS| ||j|j'|j |j|j(|j*| |j|j|j|j |jXsdT} | StW|j(|j'|j| YS#tX$r|jdRkrt=dZYdTSwxYw)[zScript main program.rNz1Utilities to support installing Python libraries.) descriptionz-l store_constr z!don't recurse into subdirectories)actionconstr4desthelpz-r recursionzhcontrol the maximum recursion level. if `-l` and `-r` options are specified, then `-r` takes precedence.)typerrz-f store_truer/z/force rebuild even if timestamps are up to date)rrrz-qcountr zIoutput only error messages; -qq will suppress the error messages as well.)rrr4rz-br1z0use legacy (pre-PEP3147) compiled file locationsz-dDESTDIRr.zdirectory to prepend to file paths for use in compile-time tracebacks and in runtime tracebacks in cases where the source file is unavailable)metavarrr4rz-sSTRIPDIRr%zpart of path to left-strip from path to source file - for example buildroot. `-d` and `-s` options cannot be specified together.z-p PREPENDDIRr&zpath to add as prefix to path to source file - for example / to make it absolute when some part is removed by `-s` option. `-d` and `-p` options cannot be specified together.z-xREGEXPr0zskip 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)rrr compile_destzFILE|DIR*zrzero or more file and directory names to compile; if no arguments given, defaults to the equivalent of -l sys.path)rnargsrz-jz --workersr zRun compileall concurrently)r4rrchg|]/}|jdd0S)_-)r lowerreplace).0modes r" zmain..isJFFF")//++33C==FFFrz--invalidation-modezset .pyc invalidation mode; defaults to "checked-hash" if the SOURCE_DATE_EPOCH environment variable is set, and "timestamp" otherwise.)choicesrz-oappend opt_levelszOptimization levels to run compilation with. Default is -1 which uses the optimization level of the Python interpreter itself (see -O).)rrrrz-eDIRr'z+Ignore symlinks pointing outsite of the DIRz--hardlink-dupesr(zHardlink duplicated pyc filesrEr#zYHardlinking of duplicated bytecode makes sense only for more than one optimization level.z.-d cannot be used in combination with -s or -przutf-8)rqr zError reading file list {}FrT)r3r%r&r2r'r()r=r3r%r&r2r'r()r1r/r r3z [interrupted])-argparseArgumentParser add_argumentrUriPycInvalidationModerV parse_argsrr0rerjr'rr rrXr(errorr.r%r&rr9stdinrfrstriprr rrr3rupperrrr\rr/r1rr=rKeyboardInterrupt) rparserinvalidation_modesargs compile_destsrr flineivl_moder3r?rs r"mainr4sOOO  $ $G%IIF ]! $;@BBB 3[<>>> \NPPP W7A;<<< \OQQQ ivt,...  j $4666  l, $4666 hT4HJJJ f7BDDD  #ACCC k1 'DFFFFF&0&DFFF - &'9 : :7999  XClKMMM e/JLLL *<-<>>>     D%M w& **TW%% R! ~!N N  $ 4?q  T%8  C E E E y !T_%@ EFFF z  #z3#))g666 7;<77D!((66667 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7   zA~~299$*EEFFF55   !)11#s;;AACC&:8D G   E% ( (7>>$''('diTW(, DK:K1537?156:6H7;7JLLL(#(&tY '+z47DJ'+{DL9J04 26/04595G6:6IKKK (#(Nt{$*&*j2CEEE E  :>> # $ $ $uusO-L:4-L." L:.L22L:5L26L::rs}     7 7 7.....7