grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026o ®û|jOã@sÔdZddlZddlZddlZddlZddlZddlZddlm Z ddl m Z gd¢Z ddd„Z  dddddd œd d „Z  dddddd œdd„Z  ddd„Zdd„Zedkrheeƒ ƒZe e¡dSdS)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)ÚPath)Ú compile_dirÚ compile_fileÚ compile_pathccsü�|dkrt|tjƒrt |¡}|std |¡ƒzt |¡}Wnty6|dkr2td |¡ƒg}Ynw| ¡|D]>}|dkrDq=tj   ||¡}tj   |¡sU|Vq=|dkr{|tj kr{|tj kr{tj   |¡r{tj  |¡s{t||d|d�EdHq=dS)NézListing {!r}...zCan't list {!r}Ú __pycache__ré)Ú maxlevelsÚquiet)Ú isinstanceÚosÚPathLikeÚfspathÚprintÚformatÚlistdirÚOSErrorÚsortÚpathÚjoinÚisdirÚcurdirÚpardirÚislinkÚ _walk_dir)Údirr r ÚnamesÚnameÚfullname©r ú1/opt/alt/python310/lib64/python3.10/compileall.pyrs:€  ý  ÿ ÿ  ÿ€ørFéÿÿÿÿr ©ÚstripdirÚ prependdirÚ limit_sl_destÚhardlink_dupesc CsZd}|dur| dus| durtdƒ‚|dur|} |} d}|dkr$tdƒ‚|dkrEddlm}z|ƒWn ty>d}Ynwddlm}|durMt ¡}t|||d�}d }|dkr”|dur”|pad}||d ��#}|  t t ||||||| | | | | d � |¡}t |d d �}Wdƒ|S1s�wY|S|D]}t |||||||| | | | | d � sªd}q–|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 `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 NúPDestination 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)Z max_workers) ÚddirÚforceÚrxr ÚlegacyÚoptimizeÚinvalidation_moder$r%r&r')Údefaultr#F) Ú ValueErrorZconcurrent.futures.processr)ÚNotImplementedErrorZconcurrent.futuresr*ÚsysÚgetrecursionlimitrÚmaprrÚmin)rr r+r,r-r r.r/Úworkersr0r$r%r&r'r*r)ÚfilesÚsuccessZexecutorZresultsÚfiler r r!r0sh   ÿ  ÷ ö ôëù ü€rc& Csn|dur|dus | durtdƒ‚d} t |¡}|dur t |¡nd}tj |¡} d}|dur5tj || ¡}|durd| tjj¡}| tjj¡}t|ƒ}t ||ƒD] \}}||kr]|  |¡qPtjj|Ž}| dur{|durttj | |¡}ntj | |¡}t |t ƒrƒ|g}t t|ƒƒ}| r•t|ƒdkr•tdƒ‚|dur¢| |¡}|r¢| S| dur»tj |¡r»t| ƒ ¡t|ƒ ¡jvr»| Si}tj |¡�r5|D].}|rÑ|d||<qÆ|dkrê|dkrÛ|nd }tjj||d �}|||<qÆtj |¡}|||<qÆ| dd …| d d…}}|d k�r5|�sXzCt t |¡jƒ}t d tjjd|d@¡}| ¡D]%}t|dƒ� }|  d¡}Wdƒn 1�s;wY||k�rGn�q#| WSWn t!�yWYnw|�sbt"d #|¡ƒz?t$|ƒD]8\}}||}t%j&|||d||d�} |dk�rž| �rž|||d}!t'j(||!dd��ržt )|¡t *|!|¡�qgWnŒt%j+�yî}"z?d} |dk�rº| WYd}"~"S|�rÅt"d #|¡ƒnt"dd d�t,j-j.�pÓt, /¡}#|"j0j1|#dd� 2|#¡}$t"|$ƒWYd}"~"| Sd}"~"wt3t4t!f�y-}%z0d} |dk�r| WYd}%~%S|�rt"d #|¡ƒnt"dd d�t"|%j5j6d|%ƒWYd}%~%| Sd}%~%ww| dk�r5d} | 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: 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. 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 Nr(TrzXHardlinking of duplicated bytecode makes sense only for more than one optimization levelÚcrr Ú)Ú optimizationéýÿÿÿz.pyz<4sLLlÿÿÚrbé zCompiling {!r}...)r/r0F)Zshallowz*** Error compiling {!r}...z*** )ÚendÚbackslashreplace)Úerrorsú:)7r2r rrÚbasenamerÚsplitÚsepÚlistÚzipÚremover ÚintÚsortedÚsetÚlenÚsearchrrZresolveÚparentsÚisfileÚ importlibÚutilÚcache_from_sourceÚstatÚst_mtimeÚstructZpackÚ MAGIC_NUMBERÚvaluesÚopenÚreadrrrÚ enumerateÚ py_compileÚcompileÚfilecmpZcmpÚunlinkÚlinkÚPyCompileErrorr4ÚstdoutÚencodingÚgetdefaultencodingÚmsgÚencodeÚdecodeÚ SyntaxErrorÚ UnicodeErrorÚ __class__Ú__name__)&rr+r,r-r r.r/r0r$r%r&r'r:rÚdfileZfullname_partsZstripdir_partsZ ddir_partsZspartZopartZmoZ opt_cfilesÚ opt_levelÚoptÚcfileÚheadÚtailÚmtimeZexpectZchandleZactualÚindexÚokZprevious_cfileÚerrrergÚer r r!r}sÚ   €    ÿ     ÿ   ÿ ÿþÿ þ  €÷    €ô  €ô rc CsTd}tjD]"}|r|tjkr|r|dkrtdƒq|o&t||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/r0)r4rr rrr) Z skip_curdirr r,r r.r/r0r:rr r r!rs" €ø rc Cs¸ddl}|jdd�}|jddddddd �|jd td d d �|jddddd�|jdddddd�|jddddd�|jdddddd�|jd d!d"dd#d�|jd$d%d&dd'd�|jd(d)d*dd+d�|jd,d-d.d/d0�|jd1d2d3d4d5�|jd6d7d8td9d:�d;d<„tjDƒ}|jd=t|ƒd>d?�|jd@dAtdBdCdD�|jdEdFdGdHd0�|jdIddJdKd�| ¡}|j}|j rÁddl }|  |j ¡|_ |j dLkrÉd|_ |j durÒ|j }n|j}|jdurÞdMg|_t|jƒd8krí|jrí| dN¡|jdu�r|jdusþ|jdu�r| dO¡|j�rQz0|jdPk�rtjnt|jdQdR��}|D] }| | ¡¡�qWdƒn 1�s1wYWnt�yP|jdSk�rMtdT |j¡ƒYdUSw|j �rd|j  !dPdV¡ "¡} tj| } nd} dW} z^|�r»|D]I} t#j$ %| ¡�r–t&| |j|j'|j |j|j(| |j|j|j|j |jdX� �s”dU} �qnt)| ||j|j'|j |j|j(|j*| |j|j|j|j |jdY��s¶dU} �qn| WSt+|j(|j'|j| dZ�WSt,�yÛ|jdSk�rØtd[ƒYdUSw)\zScript main program.rNz1Utilities to support installing Python libraries.)Ú descriptionz-lZ store_constr z!don't recurse into subdirectories)ÚactionZconstr1ÚdestÚhelpz-rÚ recursionzhcontrol the maximum recursion level. if `-l` and `-r` options are specified, then `-r` takes precedence.)Útyper{r|z-fÚ store_truer,z/force rebuild even if timestamps are up to date)rzr{r|z-qÚcountr zIoutput only error messages; -qq will suppress the error messages as well.)rzr{r1r|z-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)Úmetavarr{r1r|z-sZSTRIPDIRr$z€part of path to left-strip from path to source file - for example buildroot. `-d` and `-s` options cannot be specified together.z-pZ PREPENDDIRr%z®path 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-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)r�r{r|Ú compile_destzFILE|DIRÚ*zrzero or more file and directory names to compile; if no arguments given, defaults to the equivalent of -l sys.path)r�Únargsr|z-jz --workersr zRun compileall concurrently)r1r~r|cSsg|] }|j ¡ dd¡‘qS)Ú_ú-)rÚlowerÚreplace)Ú.0Úmoder r r!Ú isÿzmain..z--invalidation-modez‡set .pyc invalidation mode; defaults to "checked-hash" if the SOURCE_DATE_EPOCH environment variable is set, and "timestamp" otherwise.)Úchoicesr|z-oÚappendÚ opt_levelsz‡Optimization levels to run compilation with. Default is -1 which uses the optimization level of the Python interpreter itself (see -O).)rzr~r{r|z-eZDIRr&z+Ignore symlinks pointing outsite of the DIRz--hardlink-dupesr'zHardlink duplicated pyc filesr=r"zYHardlinking of duplicated bytecode makes sense only for more than one optimization level.z.-d cannot be used in combination with -s or -pr‡zutf-8)rerzError reading file list {}Fr†T)r0r$r%r/r&r')r8r0r$r%r/r&r')r.r,r r0z [interrupted])-ÚargparseÚArgumentParserÚ add_argumentrLr^ÚPycInvalidationModerMÚ parse_argsrƒr-Úrer_r&r}r r�rOr'Úerrorr+r$r%r‚r4Ústdinr[rŽÚstriprr rrr0r‰Úupperr rrRrr,r.rr8rÚKeyboardInterrupt) r�ÚparserZinvalidation_modesÚargsZ compile_destsr•r ÚfÚlineZivl_moder0r:r{r r r!Úmain4sÿ þ ÿ ÿ ÿ ÿ ÿ þ þ ÿ ÿ ÿ ÿÿþ ÿ ÿþ       ÿÿþ€ ý ù€  ø € þ ýrŸÚ__main__)r) NNFNrFr"r N)NFNrFr"N)r rFrFr"N)Ú__doc__r r4Úimportlib.utilrSr^rXr`Ú functoolsrZpathlibrÚ__all__rrrrrŸrmrLZ exit_statusÚexitr r r r!ÚsH    þ ýMþ ý þ" þ