grthtrhthjhtyjytjytkergtrhtrjytjerhrfh3 \]/ã@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"ú"/usr/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)Z max_workers)r ÚforceÚrxr ÚlegacyÚoptimize)ÚdefaultF) Ú ValueErrorZconcurrent.futuresr$Ú ImportErrorrÚmaprrÚmin)rr r r%r&r r'r(Úworkersr$ÚfilesÚsuccessZexecutorZresultsÚ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ÚstructZpackÚ 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(r0rr!ZmoÚcfileÚoptZ cache_dirÚheadÚtailÚmtimeZexpectZchandleZactualÚokÚerrrNÚ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()rPrrrrr)Z skip_curdirr r%r r'r(r0rr"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.)Z descriptionz-lZ store_constrr z!don't recurse into subdirectories)ÚactionZconstr)ÚdestÚhelpz-rÚ recursionzhcontrol the maximum recursion level. if `-l` and `-r` options are specified, then `-r` takes precedence.)Útyperarbz-fÚ store_truer%z/force rebuild even if timestamps are up to date)r`rarbz-qÚcountr zIoutput only error messages; -qq will suppress the error messages as well.)r`rar)rbz-br'z0use legacy (pre-PEP3147) compiled file locationsz-dZDESTDIRr 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)Úmetavarrar)rbz-xZREGEXPr&zskip files matching the regular expression; the regexp is searched for in the full path of each file considered for compilationz-iZFILEÚflistzzadd all the files and directories listed in FILE to the list considered for compilation; if "-", names are read from stdin)rgrarbÚ compile_destzFILE|DIRÚ*zrzero or more file and directory names to compile; if no arguments given, defaults to the equivalent of -l sys.path)rgÚnargsrbz-jz --workersr zRun compileall concurrently)r)rdrbú-rzError reading file list {}FT)r.)r'r%r z [interrupted]) ÚargparseÚArgumentParserÚ add_argumentrDÚ parse_argsrir&ÚrerLrcr rhrPÚstdinrIÚappendÚstriprr rrr.rrr?rr r%r'rrÚKeyboardInterrupt) rmÚparserÚargsZ compile_destsrqr ÚfÚliner0rar"r"r#ÚmainÎs~             "        rzÚ__main__)Nrréÿÿÿÿ)rNFNrFr|r r|)NFNrFr|r|)r rFrFr|)rrPÚimportlib.utilr@rKrGÚ functoolsrÚ__all__rrrrrzrWrDZ exit_statusÚexitr"r"r"r#Ú s"    / R [