Your IP : 18.119.166.34


Current Path : /opt/alt/python35/lib64/python3.5/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/__pycache__/compileall.cpython-35.opt-2.pyc



���]�-�@s8ddlZddlZddlZddlZddlZyddlmZWnek
rjdZYnXddl	m
Z
dddgZddddd	�Zddd
ddd
dddd�Z
dd
ddd
dd
d�Zddd
dd
ddd�Zdd�Zedkr4ee��Zeje�dS)�N)�ProcessPoolExecutor)�partial�compile_dir�compile_file�compile_path�
ccsa|stdj|��ytj|�}Wn7tk
re|dkr[tdj|��g}YnX|j�x�|D]�}|dkr�qwtjj||�}|dk	r�tjj||�}nd}tjj|�s�|Vqw|dkrw|tj	krw|tj
krwtjj|�rwtjj|�rwt|d|d|dd	|�EdHqwWdS)
NzListing {!r}...�zCan't list {!r}�__pycache__r�ddir�	maxlevels��quiet)
�print�format�os�listdir�OSError�sort�path�join�isdir�curdir�pardir�islink�	_walk_dir)�dirr
rr
�names�name�fullname�dfile�r �//opt/alt/python35/lib64/python3.5/compileall.pyrs,


*%rFrc	Cs|dk	r$|dkr$td��t|d|d|d|�}	d}
|dk	r�|dkr�tdk	r�|pud}td|��U}|jttd|d|d	|d|d
|d|�|	�}t|dd�}
WdQRXn5x2|	D]*}
t|
||||||�s�d}
q�W|
S)
Nrz%workers must be greater or equal to 0r
rr
r�max_workers�force�rx�legacy�optimize�default)�
ValueErrorrr�maprr�min)rrr
r#r$r
r%r&�workers�files�success�executor�results�filer r r!r4s(	$	

cCs'd}tjj|�}|dk	r<tjj||�}	nd}	|dk	rg|j|�}
|
rg|Stjj|�r#|r�|d}nc|dkr�|dkr�|nd}tjj|d|�}ntjj|�}tjj	|�}
|dd�|dd�}}|dkr#|s�yot
tj|�j�}t
jdtjj|�}t|d	��}|jd
�}WdQRX||kr�|SWntk
r�YnX|s�tdj|��y"tj|||	dd
|�}Wn-tjk
r�}z�d}|dkr|S|r+tdj|��ntddd�|jjtjjdd�}|jtjj�}t|�WYdd}~Xn�tttfk
r}z^d}|dkr�|S|r�tdj|��ntddd�t|j j!d|�WYdd}~XnX|dkr#d}|S)Nr�cr��optimization�z.pyz<4sl�rb�zCompiling {!r}...Tr&rz*** Error compiling {!r}...z*** �end�errors�backslashreplace�:���r;)"rr�basenamer�search�isfile�	importlib�util�cache_from_source�dirname�int�stat�st_mtime�struct�pack�MAGIC_NUMBER�open�readrrr�
py_compile�compile�PyCompileError�msg�encode�sys�stdout�encoding�decode�SyntaxError�UnicodeError�	__class__�__name__)rr
r#r$r
r%r&r-rr�mo�cfile�opt�	cache_dir�head�tail�mtime�expect�chandle�actual�ok�errrN�er r r!r\st
	!	

	*cCs�d}xstjD]h}|s,|tjkrK|rK|dkrxtd�q|out||d|d|d|d|�}qW|S)NrrzSkipping current directoryr
r%r&)rPrrrrr)�skip_curdirrr#r
r%r&r-rr r r!r�s

c
Cs�ddl}|jdd�}|jddddddd	d
ddd
�|jddtd
ddd�|jdddd
ddd�|jdddd
ddddd�|jdddd
ddd�|jdddd
d dddd!�|jd"dd#d
d$dddd%�|jd&dd'd
d(dd)�|jd*dd+d,d-dd.�|jd/d0dd1dtdd2�|j�}|j}|jr�ddl}|j|j�|_|j	dk	r�|j	}n	|j
}|jrxyY|jd3kr�tj
nt|j��+}x!|D]}|j|j��qWWdQRXWn;tk
rw|jd4krotd5j|j��d6SYnX|jdk	r�|jp�d|_d7}y�|r>x�|D]�}	tjj|	�r�t|	|j|j|j|j|j�s6d6}q�t|	||j|j|j|j|jd8|j�s�d6}q�W|Std|jd|jd|j�SWn/tk
r�|jd4kr�td9�d6SYnXd7S):Nr�descriptionz1Utilities to support installing Python libraries.z-l�action�store_const�constr'r�destr�helpz!don't recurse into subdirectoriesz-r�type�	recursionzhcontrol the maximum recursion level. if `-l` and `-r` options are specified, then `-r` takes precedence.z-f�
store_truer#z/force rebuild even if timestamps are up to datez-q�countr
zIoutput only error messages; -qq will suppress the error messages as well.z-br%z0use legacy (pre-PEP3147) compiled file locationsz-d�metavar�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 unavailablez-x�REGEXPr$zskip 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�compile_destzFILE|DIR�nargs�*zrzero or more file and directory names to compile; if no arguments given, defaults to the equivalent of -l sys.pathz-jz	--workersrzRun compileall concurrently�-rzError reading file list {}FTr+z
[interrupted]) �argparse�ArgumentParser�add_argumentrC�
parse_argsrur$�rerLrmrrtrP�stdinrI�append�striprr
rrr+rrr>rr
r#r%rr�KeyboardInterrupt)
ry�parser�args�
compile_destsr}r�f�liner-rjr r r!�main�s~		
				*
"
	
	


	r��__main__���r�r�)rrP�importlib.utilr?rKrF�concurrent.futuresr�ImportError�	functoolsr�__all__rrrrr�rWrC�exit_status�exitr r r r!�<module>
s*
'P[

?>