grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026U iÛfn5ã @sœdZddlZddlZddlZddlZddlZddlmZdddgZ ddd „Z dd d„Z dd„Z ddd„Z ddd„Zdd„Zedkr˜eeƒ ƒZe e¡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)ÚpartialÚ compile_dirÚ compile_fileÚ compile_pathé ccs|dkrt|tjƒrt |¡}|s0td |¡ƒzt |¡}Wn.tk rl|dkrdtd |¡ƒg}YnX| ¡|D]ž}|dkrˆqztj   ||¡}|dk r®tj   ||¡}nd}tj   |¡sÊ||fVqz|dkrz|tj krz|tj krztj   |¡rztj  |¡szt|||d|d�EdHqzdS)NézListing {!r}...zCan't list {!r}Ú __pycache__ré)ÚddirÚ maxlevelsÚquiet)Ú isinstanceÚosÚPathLikeÚfspathÚprintÚformatÚlistdirÚOSErrorÚsortÚpathÚjoinÚisdirÚcurdirÚpardirÚislinkÚ _walk_dir)Údirr r r ÚnamesÚnameÚfullnameÚdfile©r"ú//opt/alt/python38/lib64/python3.8/compileall.pyrs:     ÿ ÿÿrFéÿÿÿÿr c  Csàd} |dkrtdƒ‚|dkrFzddlm} Wntk rDd}YnXt||||d�} d} |dkr´| dk r´|ppd}| |d��0} |  tt|||||| d �| ¡}t|dd �} W5QRXn(| D]"\}}t |||||||| ƒs¸d } q¸| 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 invalidation_mode: how the up-to-dateness of the pyc will be checked Nrz%workers must be greater or equal to 0r )ÚProcessPoolExecutor)r r r T)Z max_workers)ÚforceÚrxr ÚlegacyÚoptimizeÚinvalidation_mode)ÚdefaultF) Ú ValueErrorZconcurrent.futuresr%Ú ImportErrorrÚmaprÚ_compile_file_tupleÚminr)rr r r&r'r r(r)Úworkersr*r%Zfiles_and_ddirsÚsuccessZexecutorZresultsÚfiler!r"r"r#r2sF ÿ ýú  ÿcKs|\}}t||f|ŽS)z-Needs to be toplevel for ProcessPoolExecutor.)r)Zfile_and_dfileÚkwargsr3r!r"r"r#r/esr/c Cs¢d}|dkr"t|tjƒr"t |¡}tj |¡} |dk rFtj || ¡} nd} |dk rd| |¡} | rd|Stj |¡�rž|r€|d} nB|dkrª|dkr”|nd} t j j || d�} n t j   |¡} tj  | ¡}| dd …| d d…}}|d k�rž|�s\zXt t |¡jƒ}t d t j jd|¡}t| d ƒ�}| d ¡}W5QRX||k�rB|WSWntk �rZYnX|�sptd |¡ƒztj|| | d||d�}W�ntjk �r}zjd}|dk�r¼|WY¢RS|�rÒtd |¡ƒn tddd�|jjtjjdd�}|  tjj¡}t|ƒW5d}~XYn†t!t"tfk �rŽ}zRd}|dk�rJ|WY¢:S|�r`td |¡ƒn tddd�t|j#j$d|ƒW5d}~XYnX|dk�ržd}|S)aTByte-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 invalidation_mode: how the up-to-dateness of the pyc will be checked TrNÚcrr Ú)Ú optimizationéýÿÿÿz.pyz<4sllÚrbé zCompiling {!r}...)r)r*Fz*** Error compiling {!r}...z*** )ÚendÚbackslashreplace)Úerrorsú:)%r rrrrÚ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__)r r r&r'r r(r)r*r2rr!ZmoÚcfileÚoptZ cache_dirÚheadÚtailÚmtimeZexpectZchandleZactualÚokÚerrrPÚer"r"r#rjs†    ÿ    ÿ    þ     ÿ   $ c CsTd}tjD]D}|r|tjkr2|r2|dkrNtdƒq |oLt||d|||||d�}q |S)a¤Byte-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() TrzSkipping current directoryN)r r(r)r*)rRrrrrr) Z skip_curdirr r&r r(r)r*r2rr"r"r#rÀs   ø c Cs¸ddl}|jdd�}|jdddddd d �|jd td d d�|jddddd�|jdddddd�|jddddd�|jdddddd �|jd!d"d#dd$d �|jd%d&d'd(d)�|jd*d+d,d-d.�|jd/d0d1td2d3�d4d5„tjDƒ}|jd6t|ƒd7d8�| ¡}|j}|j �r$ddl }|  |j ¡|_ |j dk �r8|j }n|j }|j�rÂzF|jd9k�rZtjnt|jƒ� }|D]}| | ¡¡�qjW5QRXWn4tk �rÀ|jd:k�rºtd; |j¡ƒYd} z–|�rl|D]h} tj | ¡�r6t| |j|j |j |j|j!| d?��sbd<} n,t"| ||j|j |j |j|j!|j#| d@� �süd<} �qü| WSt$|j!|j |j| dA�WSWn,t%k �r²|jd:k�r¬tdBƒYdS)CzScript main program.rNz1Utilities to support installing Python libraries.)Z descriptionz-lZ store_constrr z!don't recurse into subdirectories)ÚactionZconstr+ÚdestÚhelpz-rÚ recursionzhcontrol the maximum recursion level. if `-l` and `-r` options are specified, then `-r` takes precedence.)Útypercrdz-fÚ store_truer&z/force rebuild even if timestamps are up to date)rbrcrdz-qÚcountr zIoutput only error messages; -qq will suppress the error messages as well.)rbrcr+rdz-br(z0use legacy (pre-PEP3147) compiled file locationsz-dZDESTDIRr z�directory to prepend to file paths for use in compile-time tracebacks and in runtime tracebacks in cases where the source file is unavailable)Úmetavarrcr+rdz-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)rircrdÚ compile_destzFILE|DIRÚ*zrzero or more file and directory names to compile; if no arguments given, defaults to the equivalent of -l sys.path)riÚnargsrdz-jz --workersr zRun compileall concurrently)r+rfrdcSsg|]}|j ¡ dd¡‘qS)Ú_ú-)rÚlowerÚreplace)Ú.0Úmoder"r"r#Ú sÿzmain..z--invalidation-modez‡set .pyc invalidation mode; defaults to "checked-hash" if the SOURCE_DATE_EPOCH environment variable is set, and "timestamp" otherwise.)ÚchoicesrdrorzError reading file list {}FrnT)r*)r1r*)r(r&r r*z [interrupted])&ÚargparseÚArgumentParserÚ add_argumentrFrMÚPycInvalidationModeÚsortedÚ parse_argsrkr'ÚrerNrer rjrRÚstdinrKÚappendÚstriprr rrr*rqÚupperrrrArr r&r(rr1rÚKeyboardInterrupt) rvÚparserZinvalidation_modesÚargsZ compile_destsr|r ÚfÚlineZivl_moder*r2rcr"r"r#Úmainâs¾ÿ þ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿÿþ    þ ý þ  r†Ú__main__)Nrr) rNFNrFr$r N)NFNrFr$N)r rFrFr$N)Ú__doc__rrRÚimportlib.utilrBrMrIÚ functoolsrÚ__all__rrr/rrr†rYrFZ exit_statusÚexitr"r"r"r#Ús<    þ 3þ Vþ "i