grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/20263 Õì2a]/ã@s�ddlZddlZddlZddlZddlZddlmZdddgZddd„Z dd d„Z dd d„Z dd d„Z dd„Z edkrŒee ƒ ƒZejeƒdS)éN)ÚpartialÚ compile_dirÚ compile_fileÚ compile_pathé ccs |dkrt|tjƒrtj|ƒ}|s0tdj|ƒƒytj|ƒ}Wn.tk rl|dkrdtdj|ƒƒg}YnX|jƒx¤|D]œ}|dkrŠq|tj j ||ƒ}|dk r°tj j ||ƒ}nd}tj j |ƒsÈ|Vq||dkr||tj kr||tj kr|tj j |ƒr|tj j|ƒ r|t|||d|d�EdHq|WdS)NézListing {!r}...zCan'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/python36/lib64/python3.6/compileall.pyrs0    rFr c Csðd} |dk rP|dkrtdƒ‚n2|dkrPyddlm} Wntk rNd}YnXt||||d�} d} |dk rÆ|dkrÆ| dk rÆ|p‚d}| |d��0} | jtt||||||d�| ƒ} t| dd �} WdQRXn&x$| D]}t|||||||ƒsÌd } qÌW| S) Nrz%workers must be greater or equal to 0r )ÚProcessPoolExecutor)r r r T)Ú max_workers)r ÚforceÚrxr ÚlegacyÚoptimize)ÚdefaultF) Ú ValueErrorÚconcurrent.futuresr$Ú ImportErrorrÚmaprrÚmin)rr r r&r'r r(r)Úworkersr$ÚfilesÚsuccessÚexecutorÚresultsÚfiler"r"r#r2s6     cCsŠd}|dkr"t|tjƒr"tj|ƒ}tjj|ƒ}|dk rFtjj||ƒ} nd} |dk rd|j|ƒ} | rd|Stjj|ƒ�r†|r€|d} nB|dkrª|dkr”|nd} t j j || d�} n t j j |ƒ} tjj | ƒ} |dd…|dd…}}|d k�r†|�sXyTt tj|ƒjƒ}tjd t j j|ƒ}t| d ƒ�}|jd ƒ}WdQRX||k�r>|SWntk �rVYnX|�sltd j|ƒƒytj|| | d|d�}Wnòtjk �r}zdd}|dk�r¬|S|�rÂtdj|ƒƒn tddd�|jjtjjdd�}|j tjjƒ}t|ƒWYdd}~Xn~t!t"tfk �rv}zLd}|dk�r2|S|�rHtdj|ƒƒn tddd�t|j#j$d|ƒWYdd}~XnX|dk�r†d}|S)NTrÚcrr Ú)Ú optimizationéz.pyz<4slÚrbézCompiling {!r}...)r)Fz*** Error compiling {!r}...z*** )ÚendÚbackslashreplace)Úerrorsú:éýÿÿÿr@)%r rrrrÚ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__)r r r&r'r r(r)r2rr!ÚmoÚcfileÚoptÚ cache_dirÚheadÚtailÚmtimeÚexpectÚchandleÚactualÚokÚerrrSÚer"r"r#rbsx                  $ c CsXd}xNtjD]D}| s |tjkr6|r6|dkrPtdƒq |oNt||d||||d�}q W|S)NTrzSkipping current directory)r r(r))rUrrrrr)Ú skip_curdirr r&r r(r)r2rr"r"r#rµs    c Cszddl}|jdd�}|jddddddd �|jd td d d �|jddddd�|jdddddd�|jddddd�|jdddddd�|jd d!d"dd#d�|jd$d%d&d'd(�|jd)d*d+d,d-�|jd.d/d0td1d2�|jƒ}|j}|jrþddl}|j|jƒ|_|j dk �r|j }n|j }|j �ržyJ|j d3k�r4t j nt|j ƒ�$}x|D]}|j|jƒƒ�qFWWdQRXWn2tk �rœ|jd4k�r˜td5j|j ƒƒd6SX|jdk �r¸|j�p´d|_d7}yŽ|�r4xj|D]b} tjj| ƒ�rt| |j|j|j|j|jƒ�s*d6}n*t| ||j|j|j|j|j|jd8��sÊd6}�qÊW|St|j|j|jd9�SWn*tk �rt|jd4k�rptd:ƒd6SXd7S);Nrz1Utilities to support installing Python libraries.)Ú descriptionz-lÚ store_constrr z!don't recurse into subdirectories)ÚactionÚconstr*ÚdestÚhelpz-rÚ recursionzhcontrol the maximum recursion level. if `-l` and `-r` options are specified, then `-r` takes precedence.)Útyperorpz-fÚ store_truer&z/force rebuild even if timestamps are up to date)rmrorpz-qÚcountr zIoutput only error messages; -qq will suppress the error messages as well.)rmror*rpz-br(z0use legacy (pre-PEP3147) compiled file locationsz-dÚ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)Úmetavarror*rpz-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)rvrorpÚ compile_destzFILE|DIRÚ*zrzero or more file and directory names to compile; if no arguments given, defaults to the equivalent of -l sys.path)rvÚnargsrpz-jz --workersr zRun compileall concurrently)r*rrrpú-rzError reading file list {}FT)r0)r(r&r z [interrupted]) ÚargparseÚArgumentParserÚ add_argumentrHÚ parse_argsrzr'ÚrerQrqr ryrUÚstdinrNÚappendÚstriprr rrr0rrrCrr r&r(rrÚKeyboardInterrupt) r~ÚparserÚargsÚ compile_destsr‚r ÚfÚliner2ror"r"r#ÚmainÎs~             "        rŒÚ__main__)Nrréÿÿÿÿ)rNFNrFrŽr rŽ)NFNrFrŽrŽ)r rFrFrŽ)rrUÚimportlib.utilrDrPrKÚ functoolsrÚ__all__rrrrrŒr\rHÚ exit_statusÚexitr"r"r"r#Ú s"    / R [