<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
a
    XC?hN                  	   @   s   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dZdddddd
ddZdddddd
ddZdddZdd Zedkree  Zee dS )    N)partial)Path)compile_dircompile_filecompile_pathc                 c   s   |dk rt | tjrt| } |s0td|  zt| }W n, tyj   |dk rbtd|  g }Y n0 |  |D ]|}|dkrqxtj	
| |}tj	|s|V  qx|dkrx|tjkrx|tjkrxtj	|rxtj	|sxt||d |dE d H  qxd S )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fullname r    //opt/alt/python39/lib64/python3.9/compileall.pyr      s2    




r   Fr	   stripdir
prependdirlimit_sl_desthardlink_dupesc
                C   sN  d }|d ur$|
d us|d ur$t d|d ur8| }
|}d }|dk rHt d|dkrxzddlm} W n tyv   d}Y n0 |d u rt }t| ||d}d}|dkr|d ur|pd }||dD}|tt	|||||||	|
|||d	|}t
|dd
}W d    n1 s0    Y  n2|D ],}t	||||||||	|
|||dsd}q|S )NPDestination dir (ddir) cannot be used in combination with stripdir or prependdirr   z%workers must be greater or equal to 0r	   )ProcessPoolExecutor)r   r
   T)Zmax_workers)ddirforcerxr   legacyoptimizeinvalidation_moder$   r%   r&   r'   )defaultr#   F)
ValueErrorZconcurrent.futuresr)   ImportErrorsysgetrecursionlimitr   mapr   r   min)r   r
   r*   r+   r,   r   r-   r.   workersr/   r$   r%   r&   r'   r)   filessuccessZexecutorZresultsfiler    r    r!   r   0   sX    

.r   c          &   
   C   s  |d ur |d us|	d ur t dd}|dk rBt| tjrBt| } tj| }d }|d urhtj||}|d ur| tjj	}|tjj	}t
|}t||D ]\}}||kr|| qtjj| }|	d ur|d u rtj|	| }ntj|	|}t|tr|g}tt|}|r.t|dk r.t d|d urL|| }|rL|S |
d urtj| rt|
 t|  jvr|S i }tj| r|D ]d}|r| d ||< nJ|dkr|dkr|nd}tjj| |d	}|||< ntj| }|||< q|d d
 |d
d   }}|dkr|sztt| j}tdtjjd|d@ }| D ]L}t |d}|!d}W d    n1 s0    Y  ||kr\ qq\|W S W n t"y   Y n0 |st#d$|  zt%|D ]p\}}|| }t&j'| ||d||d} |dkr|r|||d   }!t(j)||!ddrt*| t+|!| qW n t&j,y }" z|d}|dkr|W  Y d }"~"S |rt#d$|  nt#ddd t-j.j/pt-0 }#|"j1j2|#dd3|#}$t#|$ W Y d }"~"nd }"~"0  t4t5t"fyp }% z^d}|dkr(|W  Y d }%~%S |r>t#d$|  nt#ddd t#|%j6j7d |% W Y d }%~%nd }%~%0 0 | dkrd}|S )Nr(   Tr   zXHardlinking of duplicated bytecode makes sense only for more than one optimization levelcr   r	    )optimizationz.pyz<4sLLl    rb   zCompiling {!r}...)r.   r/   F)Zshallowz*** Error compiling {!r}...z*** )endbackslashreplace)errors:)8r1   r   r   r   r   r   basenamer   splitseplistzipremoveintsortedsetlensearchr   r   Zresolveparentsisfile	importlibutilcache_from_sourcestatst_mtimestructZpackMAGIC_NUMBERvaluesopenreadr   r   r   	enumerate
py_compilecompilefilecmpZcmpunlinklinkPyCompileErrorr3   stdoutencodinggetdefaultencodingmsgencodedecodeSyntaxErrorUnicodeError	__class____name__)&r   r*   r+   r,   r   r-   r.   r/   r$   r%   r&   r'   r9   r   dfileZfullname_partsZstripdir_partsZ
ddir_partsZspartZopartZmoZ
opt_cfiles	opt_leveloptcfileheadtailmtimeZexpectZchandleZactualindexokZprevious_cfileerrrd   rf   er    r    r!   r   {   s    





*





(
r   c           	      C   sT   d}t jD ]D}|r|tjkr2| r2|dk rNtd q
|oLt||d |||||d}q
|S )NTr   zSkipping current directory)r   r-   r.   r/   )r3   r   r   r   r   r   )	Zskip_curdirr
   r+   r   r-   r.   r/   r9   r   r    r    r!   r     s     


r   c                  C   s  dd l } | jdd}|jdddd ddd |jd	td
dd |jddddd |jdddddd |jddddd |jdddd dd |jdd d!d d"d |jd#d$d%d d&d |jd'd(d)d d*d |jd+d,d-d.d/ |jd0d1d2d3d4 |jd5d6d7td8d9 d:d; tjD }|jd<t|d=d> |jd?d@tdAdBdC |jdDdEdFdGd/ |jdHddIdJd | }|j}|j	rdd l
}||j	|_	|jdKkrd |_|jd ur|j}n|j}|jd u rdLg|_t|jd7kr|jr|dM |jd ur|jd us
|jd ur|dN |jrz\|jdOkr0tjnt|j*}|D ]}||  q@W d    n1 sl0    Y  W n2 ty   |jdPk rtdQ|j Y dRS 0 |j r|j !dOdS" }	tj|	 }
nd }
dT}z|r~|D ]}t#j$%|r4t&||j|j'|j	|j|j(|
|j|j|j|j|jdUstdR}n@t)|||j|j'|j	|j|j(|j*|
|j|j|j|j|jdVsdR}q|W S t+|j(|j'|j|
dWW S W n* t,y   |jdPk rtdX Y dRS 0 dTS )YNr   z1Utilities to support installing Python libraries.)Zdescriptionz-lZstore_constr
   z!don't recurse into subdirectories)actionZconstr0   desthelpz-r	recursionzhcontrol the maximum recursion level. if `-l` and `-r` options are specified, then `-r` takes precedence.)typery   rz   z-f
store_truer+   z/force rebuild even if timestamps are up to date)rx   ry   rz   z-qcountr   zIoutput only error messages; -qq will suppress the error messages as well.)rx   ry   r0   rz   z-br-   z0use legacy (pre-PEP3147) compiled file locationsz-dZDESTDIRr*   zdirectory to prepend to file paths for use in compile-time tracebacks and in runtime tracebacks in cases where the source file is unavailable)metavarry   r0   rz   z-sZSTRIPDIRr$   zpart of path to left-strip from path to source file - for example buildroot. `-d` and `-s` options cannot be specified together.z-pZ
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-xZREGEXPr,   zskip files matching the regular expression; the regexp is searched for in the full path of each file considered for compilationz-iZFILEflistzzadd all the files and directories listed in FILE to the list considered for compilation; if "-", names are read from stdin)r   ry   rz   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   nargsrz   z-jz	--workersr	   zRun compileall concurrently)r0   r|   rz   c                 S   s   g | ]}|j  d dqS )_-)r   lowerreplace).0moder    r    r!   
<listcomp>g  s   zmain.<locals>.<listcomp>z--invalidation-modezset .pyc invalidation mode; defaults to "checked-hash" if the SOURCE_DATE_EPOCH environment variable is set, and "timestamp" otherwise.)choicesrz   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).)rx   r|   ry   rz   z-eZDIRr&   z+Ignore symlinks pointing outsite of the DIRz--hardlink-dupesr'   zHardlink 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   r   zError reading file list {}Fr   T)r/   r$   r%   r.   r&   r'   )r7   r/   r$   r%   r.   r&   r'   )r-   r+   r   r/   z
[interrupted])-argparseArgumentParseradd_argumentrK   r]   PycInvalidationModerL   
parse_argsr   r,   rer^   r&   r{   r
   r   rN   r'   errorr*   r$   r%   r   r3   stdinrZ   r   stripr   r   r   r   r/   r   upperr   r   rQ   r   r+   r-   r   r7   r   KeyboardInterrupt)r   parserZinvalidation_modesargsZcompile_destsr   r
   flineZivl_moder/   r9   ry   r    r    r!   main2  s   











6
	
r   __main__)r   )	NNFNr   Fr"   r	   N)NFNr   Fr"   N)r	   r   Fr   Fr"   N)r   r3   importlib.utilrR   r]   rW   r_   	functoolsr   pathlibr   __all__r   r   r   r   r   rl   rK   Zexit_statusexitr    r    r    r!   <module>   sB   
   K       
" 