
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
U
    ¡ê,an5  ã                	   @   s˜   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dgZddd„Z	ddd„Z
dd„ Zddd„Zddd„Zdd„ Zedkr”eeƒ  ƒZe e¡ dS )é    N)ÚpartialÚcompile_dirÚcompile_fileÚcompile_pathé
   c                 c   s  |dk rt | tjƒrt | ¡} |s0td | ¡ƒ zt | ¡}W n. tk
rl   |dk rdtd | ¡ƒ g }Y nX | ¡  |D ]ž}|dkrˆqztj	 
| |¡}|d k	r®tj	 
||¡}nd }tj	 |¡sÊ||fV  qz|dkrz|tjkrz|tjkrztj	 |¡rztj	 |¡szt|||d |d�E d H  qzd S )Né   zListing {!r}...zCan'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.pyr      s:    


ÿ
ÿ ÿr   Féÿÿÿÿr	   c
                 C   sà   d }
|dk rt dƒ‚|dkrFzddlm}
 W n tk
rD   d}Y nX t| |||d�}d}|dkr´|
d k	r´|ppd }|
|d��0}| tt||||||	d�|¡}t|dd	�}W 5 Q R X n(|D ]"\}}t	||||||||	ƒs¸d
}q¸|S )Nr   z%workers must be greater or equal to 0r	   )ÚProcessPoolExecutor)r   r   r
   T)Zmax_workers)ÚforceÚrxr   ÚlegacyÚoptimizeÚinvalidation_mode)ÚdefaultF)
Ú
ValueErrorZconcurrent.futuresr%   ÚImportErrorr   Úmapr   Ú_compile_file_tupleÚminr   )r   r   r
   r&   r'   r   r(   r)   Úworkersr*   r%   Zfiles_and_ddirsÚsuccessZexecutorZresultsÚfiler!   r"   r"   r#   r   2   sF    
ÿ   ýú  ÿc                 K   s   | \}}t ||f|ŽS )N)r   )Zfile_and_dfileÚkwargsr3   r!   r"   r"   r#   r/   e   s    r/   c              
   C   s¢  d}|dk r"t | tjƒr"t | ¡} tj | ¡}	|d k	rFtj ||	¡}
nd }
|d k	rd| | ¡}|rd|S tj | ¡�rž|r€| d }nB|dkrª|dkr”|nd}t	j
j| |d�}nt	j
 | ¡}tj |¡}|	d d… |	dd …  }}|d	k�rž|�s\zXtt | ¡jƒ}t d
t	j
jd|¡}t|dƒ�}| d¡}W 5 Q R X ||k�rB|W S W n tk
�rZ   Y nX |�sptd | ¡ƒ ztj| ||
d||d�}W �n tjk
�r } zjd}|dk�r¼| W Y ¢RS |�rÒtd | ¡ƒ ntddd� |jjtjjdd�}|  tjj¡}t|ƒ W 5 d }~X Y n† t!t"tfk
�rŽ } zRd}|dk�rJ| W Y ¢:S |�r`td | ¡ƒ ntddd� t|j#j$d |ƒ W 5 d }~X Y nX |dk�ržd}|S )NTr   Úcr   r	   Ú )Úoptimizationéýÿÿÿz.pyz<4sllÚrbé   zCompiling {!r}...)r)   r*   Fz*** Error compiling {!r}...z*** )ÚendÚbackslashreplace)Úerrorsú:)%r   r   r   r   r   Úbasenamer   ÚsearchÚisfileÚ	importlibÚutilÚcache_from_sourceÚdirnameÚintÚstatÚst_mtimeÚstructZpackÚMAGIC_NUMBERÚopenÚreadr   r   r   Ú
py_compileÚcompileÚPyCompileErrorÚmsgÚencodeÚsysÚstdoutÚencodingÚdecodeÚSyntaxErrorÚUnicodeErrorÚ	__class__Ú__name__)r    r
   r&   r'   r   r(   r)   r*   r2   r   r!   ZmoÚcfileÚoptZ	cache_dirÚheadÚtailÚmtimeZexpectZchandleZactualÚokÚerrrP   Úer"   r"   r#   r   j   s†    


 ÿ
 ÿ

þ
ÿ
$
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*   )rR   r   r   r   r   r   )	Zskip_curdirr   r&   r   r(   r)   r*   r2   r   r"   r"   r#   r   À   s     

ø
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(� |jd)d*d+d,d-� |jd.d/d0td1d2� d3d4„ tjD ƒ}|jd5t|ƒd6d7� | ¡ }|j}|j	�r$dd l
}| |j	¡|_	|jd k	�r8|j}n|j}|j�rÂzF|jd8k�rZtjnt|jƒ� }|D ]}| | ¡ ¡ �qjW 5 Q R X W n4 tk
�rÀ   |jd9k �rºtd: |j¡ƒ Y d;S X |j�rè|j d8d<¡ ¡ }	tj|	 }
nd }
d=}z–|�rl|D ]h}tj |¡�r6t||j|j |j	|j|j!|
d>��sbd;}n,t"|||j|j |j	|j|j!|j#|
d?�	�süd;}�qü|W S t$|j!|j |j|
d@�W S W n, t%k
�r²   |jd9k �r¬tdAƒ Y d;S X d=S )BNr   z1Utilities to support installing Python libraries.)Zdescriptionz-lZstore_constr   r   z!don't recurse into subdirectories)ÚactionZconstr+   ÚdestÚhelpz-rÚ	recursionzhcontrol the maximum recursion level. if `-l` and `-r` options are specified, then `-r` takes precedence.)Útyperc   rd   z-fÚ
store_truer&   z/force rebuild even if timestamps are up to date)rb   rc   rd   z-qÚcountr   zIoutput only error messages; -qq will suppress the error messages as well.)rb   rc   r+   rd   z-br(   z0use legacy (pre-PEP3147) compiled file locationsz-dZDESTDIRr
   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)Úmetavarrc   r+   rd   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)ri   rc   rd   Ú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)ri   Únargsrd   z-jz	--workersr	   zRun compileall concurrently)r+   rf   rd   c                 S   s   g | ]}|j  ¡  d d¡‘qS )Ú_ú-)r   ÚlowerÚreplace)Ú.0Úmoder"   r"   r#   Ú
<listcomp>	  s   ÿzmain.<locals>.<listcomp>z--invalidation-modez‡set .pyc invalidation mode; defaults to "checked-hash" if the SOURCE_DATE_EPOCH environment variable is set, and "timestamp" otherwise.)Úchoicesrd   ro   r   zError reading file list {}Frn   T)r*   )r1   r*   )r(   r&   r   r*   z
[interrupted])&ÚargparseÚArgumentParserÚadd_argumentrF   rM   ÚPycInvalidationModeÚsortedÚ
parse_argsrk   r'   ÚrerN   re   r   rj   rR   ÚstdinrK   ÚappendÚstripr   r   r   r   r*   rq   Úupperr   r   rA   r   r
   r&   r(   r   r1   r   ÚKeyboardInterrupt)rv   ÚparserZinvalidation_modesÚargsZcompile_destsr|   r   ÚfÚlineZivl_moder*   r2   rc   r"   r"   r#   Úmainâ   s¾    ÿ
 þ
ÿ
ÿÿ
ÿÿÿ
ÿ
ÿ
 ÿÿþ  þ
   ý
þr†   Ú__main__)Nr   r   )	r   NFNr   Fr$   r	   N)NFNr   Fr$   N)r	   r   Fr   Fr$   N)r   rR   Úimportlib.utilrB   rM   rI   Ú	functoolsr   Ú__all__r   r   r/   r   r   r†   rY   rF   Zexit_statusÚexitr"   r"   r"   r#   Ú<module>   s:   

         þ
3     þ
V     þ
"i