fO ddlZddlZddlZddlZddlZddlZddlmZddl m Z gdZ ddZ dddddd d Z dddddd d Z dd Zd Zedkr&ee ZejedSdS)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 1/opt/alt/python311/lib64/python3.11/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 R d}|| | 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)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"rr0s40 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 Nsv2A5N 'N = N N N N  N N-,N-BQ00V1? T+V1BT++V1 V,V1AV,,V1c  d}tjD]E}|r|tjkr|r|dkrt d,|ot ||d|||||}F|S)NTr zSkipping current directory)r r1r2r3)r9rrrrr) skip_curdirr r/r r1r2r3r?rs r"rrs Gx sbi''['qyy2333 +!"3 # # #GG Nc ddl}|d}|dddddd|d td d |d ddd|ddddd|dddd|ddddd|dd d!dd"|d#d$d%dd&|d'd(d)dd*|d+d,d-d./|d0d1d2d34|d5d6d7td89d:tjD}|d;t |d<=|d>d?td@dAB|dCdDdEdF/|dGddHdI|}|j}|j r#ddl }| |j |_ |j dJkrd|_ |j |j }n|j}|jdKg|_t!|jd7kr|jr|dL|j#|j|j|dM|jr |jdNkr t.jnt3|jdOP5}|D])}||* dddn #1swxYwYnC#t8$r6|jdQkr't=dR|jYdSSwxYw|j r@|j !dNdT"} tj| } nd} dU} |r|D]} tFj$%| rPtM| |j|j'|j |j|j(| |j|j|j|j |jV sdS} qtS| ||j|j'|j |j|j(|j*| |j|j|j|j |jWsdS} | StW|j(|j'|j| XS#tX$r|jdQkrt=dYYdSSwxYw)ZNrz1Utilities 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;5-L/# L;/L33L;6L37L;;rsx    7 7 7.....7