
    dafP                         	 d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZ d dl	m
Z
 g dZddZ	 	 	 dddddddZ	 	 	 ddddddd	Z	 	 	 dd
Zd Zedk(  r! e e              Z ej(                  e       yy)    N)partial)Path)compile_dircompile_filecompile_pathc              #     K   |dk  r/t        | t        j                        rt        j                  |       } |st	        dj                  |              	 t        j                  |       }|j                          |D ]  }|dk(  r	t        j                  j                  | |      }t        j                  j                  |      s| M|dkD  sS|t        j                  k7  sg|t        j                  k7  s{t        j                  j                  |      st        j                  j                  |      rt        ||dz
  |      E d {     y # t        $ r% |dk  rt	        dj                  |              g }Y w xY w7 8w)N   zListing {!r}...zCan'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fullnames         %/root/Python-3.12.4/Lib/compileall.pyr   r      s-    qyZR[[1iin&&s+,

3
 
JJL 	.= 77<<T*ww}}X&N!m		 1dbii6GggmmH%bggnnX.F Y]',. . .	.  19#**3/0.sU   AFE )A$FF"F6FF6F
FF*F <F?F  FFstripdir
prependdirlimit_sl_desthardlink_dupesc
                d   	 d }||
|t        d      || }
|}d }|dk  rt        d      |dk7  rddlm} 	  |        ddlm} |t        j                         }t        | ||      }d}|dk7  r|~dd l	}|j                         d	k(  r|j                  d
      }nd }|xs d } |||      5 }|j                  t        t        |||||||	|
|||      |      }t        |d      }d d d        |S |D ]  }t        ||||||||	|
|||      rd} |S # t
        $ r d}Y w xY w# 1 sw Y   |S xY w)NPDestination dir (ddir) cannot be used in combination with stripdir or prependdirr   z%workers must be greater or equal to 0r   )_check_system_limits)ProcessPoolExecutor)r   r   Tfork
forkserver)max_workers
mp_context)ddirforcerxr   legacyoptimizeinvalidation_moder$   r%   r&   r'   )defaultr#   F)
ValueErrorconcurrent.futures.processr*   concurrent.futuresr+   NotImplementedErrorsysgetrecursionlimitr   multiprocessingget_start_methodget_contextmapr   r   min)r   r   r0   r1   r2   r   r3   r4   workersr5   r$   r%   r&   r'   r+   r*   filessuccessr=   r/   executorresultsfiles                          r"   r   r   0   s   0 X1Z5K G I 	I
{@AA!|C	? " ?))+	c)<EG!|+7++-7(44\BJJ/T W,68 	1;Cll7<04E.0284<=N4<6@9F:H	$J $)
*G '40G	1, N  	 DdE2u &2C)1j.;/=	?
  	  NM # 	G	 	1, Ns   D .9D%D"!D"%D/c          	      
   	 |||	t        d      d}t        j                  |       } |t        j                  |      nd }t        j                  j	                  |       }d }| t        j                  j                  ||      }|| j                  t        j                  j                        }|j                  t        j                  j                        }t        |      }t        ||      D ]  \  }}||k(  s|j                  |        t        j                  j
                  | }|	C|!t        j                  j                  |	|       }n t        j                  j                  |	|      }t        |t              r|g}t        t        |            }|rt        |      dk  rt        d      ||j!                  |       }|r|S |
]t        j                  j#                  |       r>t%        |
      j'                         t%        |       j'                         j(                  vr|S i }t        j                  j+                  |       r|D ]f  }|r	| dz   ||<   |dk\  r0|dk\  r|nd}t,        j.                  j1                  | |	      }|||<   Ct,        j.                  j1                  |       }|||<   h |d d
 |d
d  }}|dk(  rU|s	 t        t        j2                  |       j4                        }t7        j8                  dt,        j.                  j:                  d|dz        }|j=                         D ]/  }t?        |d      5 }|jA                  d      }d d d        |k7  s/ n |S 	 |stE        djG                  |              	 tI        |      D ]}  \  }}||   }tK        jL                  | ||d||      } |dkD  s,|s/|||dz
        }!tO        jP                  ||!d      sSt        jR                  |       t        jT                  |!|        	  dk(  rd}|S |S # 1 sw Y   xY w# tB        $ r Y w xY w# tJ        jV                  $ r}"d}|dk\  r|cY d }"~"S |rtE        djG                  |              ntE        dd       tX        jZ                  j\                  xs tY        j^                         }#|"j`                  jc                  |#d      je                  |#      }$tE        |$       Y d }"~"|S d }"~"wtf        th        tB        f$ rf}%d}|dk\  r|cY d }%~%S |rtE        djG                  |              ntE        dd       tE        |%jj                  jl                  dz   |%       Y d }%~%|S d }%~%ww xY w)Nr)   Tr	   zXHardlinking of duplicated bytecode makes sense only for more than one optimization levelcr   r    )optimizationz.pyz<4sLLl    rb   zCompiling {!r}...)r4   r5   F)shallowz*** Error compiling {!r}...z*** )endbackslashreplace)errors:)7r7   r   r   r   basenamer   splitseplistzipremover   intsortedsetlensearchr   r   resolveparentsisfile	importlibutilcache_from_sourcestatst_mtimestructpackMAGIC_NUMBERvaluesopenreadr   r   r   	enumerate
py_compilecompilefilecmpcmpunlinklinkPyCompileErrorr;   stdoutencodinggetdefaultencodingmsgencodedecodeSyntaxErrorUnicodeError	__class____name__)&r!   r0   r1   r2   r   r3   r4   r5   r$   r%   r&   r'   rD   r    dfilefullname_partsstripdir_parts
ddir_partsspartopartmo
opt_cfiles	opt_leveloptcfileheadtailmtimeexpectchandleactualindexokprevious_cfileerrrv   rx   es&                                         r"   r   r      s   . X1Z5K G I 	I Gyy"H&.&:ryy"H77H%DET4(!4!4.)
? 	)LE5~!!%(	) j)=GGLLX6EGGLLU3E(C : c(m$H#h-!+ F G 	G 
~YYx N RWW^^H%=&&(X0F0F0H0P0PPNJ	ww~~h! 	2I(03
9%>'0A~)2C&^^==%C > 9E,1Jy)%NN<<XFE,1Jy)	2 #2YRS	d5= 1 : :;E#[[)..2M2M)*EK,?AF!+!2!2!4 '!%. 6'%,\\"%5F6!V+!	'  ' "
 )00:;"$(1((; 	;$E9&y1E#++HeUD5>>OQB qy^)3HUQY4G)H";;uneLIIe,GGNE:	;@ 7#GN7N[6 6   ,, A:"N7>>xHI&b)::..J#2H2H2JggnnX6HnIPPQYZc

 N  w7 5A:"N7>>xHI&b)akk**S0!44 N5s   	A:P) PP) #P) 6P8 =P8  #P8 $-P8 P&	"P) )	P54P58U-S0U-BS00U-U(U-AU((U-c                     	 d}t         j                  D ]B  }|r|t        j                  k(  r| r|dk  s t	        d       ,|xr t        ||d |||||      }D |S )NTr	   zSkipping current directory)r   r3   r4   r5   )r;   r   r   r   r   r   )	skip_curdirr   r1   r   r3   r4   r5   rD   r   s	            r"   r   r     sq     Gxx sbii'[qy23 	+!"3	#G N    c                  
   	 dd l } | j                  d      }|j                  dddd dd       |j                  d	t        d
d       |j                  dddd       |j                  ddddd       |j                  dddd       |j                  dddd d       |j                  dd d!d d"       |j                  d#d$d%d d&       |j                  d'd(d)d d*       |j                  d+d,d-d./       |j                  d0d1d2d34       |j                  d5d6d7t        d89       t        j
                  D cg c],  }|j                  j                         j                  d:d;      . }}|j                  d<t        |      d=>       |j                  d?d@t        dAdBC       |j                  dDdEdFdG/       |j                  dHddIdJ       |j                         }|j                  }|j                  r$dd l}|j                  |j                        |_        |j                  dKk(  rd |_        |j                   |j                   }n|j"                  }|j$                  dLg|_        t'        |j$                        d7k(  r|j(                  r|j+                  dM       |j,                  )|j.                  |j0                  |j+                  dN       |j2                  rg	 |j2                  d;k(  rt4        j6                  nt9        |j2                  dOP      5 }|D ]!  }	|j;                  |	j=                                # 	 d d d        |jF                  r>|jF                  j                  d;d:      jI                         }
t        j
                  |
   }nd }dT}	 |r4|D ],  }tJ        jL                  jO                  |      rtQ        ||j,                  |jR                  |j                  |j@                  |jT                  ||j.                  |j0                  |j$                  |j                  |j(                  U      rdS}tW        |||j,                  |jR                  |j                  |j@                  |jT                  |jX                  ||j.                  |j0                  |j$                  |j                  |j(                  V      r+dS}/ |S t[        |jT                  |jR                  |j@                  |W      S c c}w # 1 sw Y   xY w# t>        $ r6 |j@                  dQk  r$tC        dRjE                  |j2                               Y ySw xY w# t\        $ r |j@                  dQk  rtC        dX       Y ySw xY w)YNr   z1Utilities to support installing Python libraries.)descriptionz-lstore_constr   z!don't recurse into subdirectories)actionconstr6   desthelpz-r	recursionzhcontrol the maximum recursion level. if `-l` and `-r` options are specified, then `-r` takes precedence.)typer   r   z-f
store_truer1   z/force rebuild even if timestamps are up to date)r   r   r   z-qcountr   zIoutput only error messages; -qq will suppress the error messages as well.)r   r   r6   r   z-br3   z0use legacy (pre-PEP3147) compiled file locationsz-dDESTDIRr0   zdirectory to prepend to file paths for use in compile-time tracebacks and in runtime tracebacks in cases where the source file is unavailable)metavarr   r6   r   z-sSTRIPDIRr$   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-xREGEXPr2   zskip files matching the regular expression; the regexp is searched for in the full path of each file considered for compilationz-iFILE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_destzFILE|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   zRun compileall concurrently)r6   r   r   _-z--invalidation-modezset .pyc invalidation mode; defaults to "checked-hash" if the SOURCE_DATE_EPOCH environment variable is set, and "timestamp" otherwise.)choicesr   z-oappend
opt_levelszOptimization levels to run compilation with. Default is -1 which uses the optimization level of the Python interpreter itself (see -O).)r   r   r   r   z-eDIRr&   z+Ignore symlinks pointing outsite of the DIRz--hardlink-dupesr'   zHardlink duplicated pyc filesrJ   zYHardlinking of duplicated bytecode makes sense only for more than one optimization level.z.-d cannot be used in combination with -s or -pzutf-8)rv   r	   zError reading file list {}FT)r5   r$   r%   r4   r&   r'   )rB   r5   r$   r%   r4   r&   r'   )r3   r1   r   r5   z
[interrupted])/argparseArgumentParseradd_argumentrZ   rn   PycInvalidationModer    lowerreplacer[   
parse_argsr   r2   rero   r&   r   r   r   r]   r'   errorr0   r$   r%   r   r;   stdinrk   r   stripr   r   r   r   r5   upperr   r   ra   r   r1   r3   r   rB   r   KeyboardInterrupt)r   parsermodeinvalidation_modesargscompile_destsr   r   flineivl_moder5   rD   r   s                 r"   mainr   :  su   $$G % IF
]! $;@  B 3[<  > \N  P
W7A;  < \O  Q
ivt,  .
 j
 $4  6 l, $4  6 hT4H  J f7B  D 
#A  C k1 'D  F '1&D&DF" ))//+33C= F F
- &'9 :7  9 XClK  M e/J  L
*<-<  > D%%Mww**TWW%R!~~!NN	NN	$
4??q T%8%8 C 	E yy!T__%@EF zz	#zz3#))g67;< 7D!((677 ))11#s;AAC&::8D G % (77>>$''diiTWW(,

DKK:K1537??156:6H6H7;7J7JL #(&tY		'+zz477DJJ'+{{DLL9J0426//04595G5G6:6I6IK #(+(, Nt{{$**&*jj2CE EuF`7 7  	zzA~299$**EF	R  ::>#$sV   61S56T 'S::T B#U	 5B
U	 U	 ,U	 :T?T <UU	#U/.U/__main__)r   )	NNFNr   Fr   r   N)NFNr   Fr   N)r   r   Fr   Fr   N)r   r;   importlib.utilrb   rn   rg   rp   	functoolsr   pathlibr   __all__r   r   r   r   r   r~   rZ   exit_statusexit r   r"   <module>r      s    
 
      
7.. 7<EF"&Q48tEQf CD(*#'S59d#ESj AB(*#'DVr z$&j/KCHH[ r   