grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026 þ“qc¿-ã@s>dZddlZddlZddlZddlZddlZyddlmZWne k rpdZYnXddl m Z dddgZ dddd d „Z ddd ddd dd d d„Zdd ddd ddd„Zd dd dd ddd„Zdd„Zedkr:eeƒ ƒZejeƒdS)aæModule/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)ÚProcessPoolExecutor)ÚpartialÚ compile_dirÚ compile_fileÚ compile_pathé ccsa|stdj|ƒƒytj|ƒ}Wn7tk re|dkr[tdj|ƒƒg}YnX|jƒxê|D]â}|dkrŒqwtjj||ƒ}|dk rÅtjj||ƒ}nd}tjj|ƒså|Vqw|dkrw|tj krw|tj krwtjj|ƒrwtjj |ƒ rwt |d|d|dd |ƒEdHqwWdS) NzListing {!r}...ézCan't list {!r}Ú __pycache__rÚddirÚ maxlevelséÚquiet) ÚprintÚformatÚosÚlistdirÚOSErrorÚsortÚpathÚjoinÚisdirÚcurdirÚpardirÚislinkÚ _walk_dir)Údirr r r ÚnamesÚnameÚfullnameÚdfile©r ú//opt/alt/python35/lib64/python3.5/compileall.pyrs,       *%rFr c Cs|dk r$|dkr$tdƒ‚t|d|d|d|ƒ} d} |dk râ|dkrâtdk râ|pud}td|ƒ�U} | jttd|d |d |d|d |d |ƒ| ƒ} t| d dƒ} WdQRXn5x2| D]*} t| ||||||ƒséd} qéW| S)a¹Byte-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 r r r Z max_workersÚforceÚrxÚlegacyÚoptimizeÚdefault)Ú ValueErrorrrÚmaprrÚmin)rr r r"r#r r$r%ÚworkersÚfilesÚsuccessZexecutorZresultsÚfiler 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#|s¦yot tj |ƒj ƒ}t jd tjj|ƒ}t| d ƒ�}|jd ƒ}WdQRX||kr�|SWntk r¥YnX|s¿td j|ƒƒy"tj|| | d d|ƒ}Wn-tjk rŠ}z„d}|dkr|S|r+tdj|ƒƒntdddƒ|jjtjjddƒ}|jtjjƒ}t|ƒWYdd}~Xn™tttfk r}z^d}|dkr»|S|r×tdj|ƒƒntdddƒt|j j!d|ƒWYdd}~XnX|dkr#d}|S)a Byte-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 r NÚcrÚÚ optimizationéz.pyz<4slÚrbézCompiling {!r}...Tr%rz*** Error compiling {!r}...z*** ÚendÚerrorsÚbackslashreplaceú:éýÿÿÿr8)"rrÚbasenamerÚsearchÚisfileÚ importlibÚutilÚcache_from_sourceÚdirnameÚintÚstatÚst_mtimeÚstructZpackÚ MAGIC_NUMBERÚopenÚreadrrrÚ py_compileÚcompileÚPyCompileErrorÚmsgÚencodeÚsysÚstdoutÚencodingÚdecodeÚ SyntaxErrorÚ UnicodeErrorÚ __class__Ú__name__)rr r"r#r r$r%r,rrZmoÚcfileZoptZ cache_dirÚheadÚtailÚmtimeZexpectZchandleZactualÚokÚerrrJÚer r r!r\st     !        * c Cs€d}xstjD]h}| s,|tjkrK|rK|dkrxtdƒq|out||d|d|d|d|ƒ}qW|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) r rzSkipping current directoryNr r$r%)rLrrrrr)Z skip_curdirr r"r r$r%r,rr r r!r­s    c Cs—ddl}|jddƒ}|jdddddd d d d d dƒ|jddtd dd dƒ|jdddd dd dƒ|jdddd dd dd dƒ|jdddd dd dƒ|jddd d d!d dd d"ƒ|jd#dd$d d%d dd d&ƒ|jd'dd(d d)d d*ƒ|jd+dd,d-d.d d/ƒ|jd0d1d d2dtd d3ƒ|jƒ}|j}|jr´ddl}|j|jƒ|_|j dk rÏ|j }n |j }|j rxyY|j d4krüt j n t|j ƒ�+}x!|D]}|j|jƒƒqWWdQRXWn;tk rw|jd5krotd6j|j ƒƒd7SYnX|jdk r™|jp“d|_d8}yÂ|r>x�|D]‡} tjj| ƒrút| |j|j|j|j|jƒs6d7}q¯t| ||j|j|j|j|jd9|jƒs¯d7}q¯W|Std|jd|jd|jƒSWn/tk r’|jd5krŠtd:ƒd7SYnXd8S);zScript main program.rNZ descriptionz1Utilities to support installing Python libraries.z-lÚactionZ store_constZconstr&rÚdestr Úhelpz!don't recurse into subdirectoriesz-rÚtypeÚ 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-qÚcountr zIoutput only error messages; -qq will suppress the error messages as well.z-br$z0use legacy (pre-PEP3147) compiled file locationsz-dÚmetavarZDESTDIRr z�directory to prepend to file paths for use in compile-time tracebacks and in runtime tracebacks in cases where the source file is unavailablez-xZREGEXPr#zskip files matching the regular expression; the regexp is searched for in the full path of each file considered for compilationz-iZFILEÚflistzzadd all the files and directories listed in FILE to the list considered for compilation; if "-", names are read from stdinÚ compile_destzFILE|DIRÚnargsÚ*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]) ÚargparseÚArgumentParserÚ add_argumentr@Ú parse_argsrdr#ÚrerHr_r rcrLÚstdinrEÚappendÚstriprr rrr*rrr;rr r"r$rrÚKeyboardInterrupt) rhÚparserÚargsZ compile_destsrlr ÚfÚliner,r\r r r!ÚmainÆs~            * "        ruÚ__main__éÿÿÿÿrwrw)Ú__doc__rrLÚimportlib.utilr<rGrCZconcurrent.futuresrÚ ImportErrorÚ functoolsrÚ__all__rrrrrurSr@Z exit_statusÚexitr r r r!Ú s,        ' P  [