/usr/lib64/python3.9/lib2to3/__pycache__
NameSizeModeActions
btm_matcher.cpython-39.opt-1.pyc48770644editdlrm
btm_matcher.cpython-39.opt-2.pyc33060644editdlrm
btm_matcher.cpython-39.pyc48770644editdlrm
btm_utils.cpython-39.opt-1.pyc61480644editdlrm
btm_utils.cpython-39.opt-2.pyc46360644editdlrm
btm_utils.cpython-39.pyc61480644editdlrm
fixer_base.cpython-39.opt-1.pyc62550644editdlrm
fixer_base.cpython-39.opt-2.pyc35040644editdlrm
fixer_base.cpython-39.pyc62550644editdlrm
fixer_util.cpython-39.opt-1.pyc121700644editdlrm
fixer_util.cpython-39.opt-2.pyc100070644editdlrm
fixer_util.cpython-39.pyc121700644editdlrm
main.cpython-39.opt-1.pyc86710644editdlrm
main.cpython-39.opt-2.pyc69180644editdlrm
main.cpython-39.pyc86890644editdlrm
patcomp.cpython-39.opt-1.pyc53890644editdlrm
patcomp.cpython-39.opt-2.pyc48810644editdlrm
patcomp.cpython-39.pyc56050644editdlrm
pygram.cpython-39.opt-1.pyc12620644editdlrm
pygram.cpython-39.opt-2.pyc10570644editdlrm
pygram.cpython-39.pyc12620644editdlrm
pytree.cpython-39.opt-1.pyc236720644editdlrm
pytree.cpython-39.opt-2.pyc149690644editdlrm
pytree.cpython-39.pyc242950644editdlrm
refactor.cpython-39.opt-1.pyc206130644editdlrm
refactor.cpython-39.opt-2.pyc165670644editdlrm
refactor.cpython-39.pyc206430644editdlrm
__init__.cpython-39.opt-1.pyc3020644editdlrm
__init__.cpython-39.opt-2.pyc3020644editdlrm
__init__.cpython-39.pyc3020644editdlrm
__main__.cpython-39.opt-1.pyc2150644editdlrm
__main__.cpython-39.opt-2.pyc2150644editdlrm
__main__.cpython-39.pyc2150644editdlrm
Edit: /usr/lib64/python3.9/lib2to3/__pycache__/main.cpython-39.pyc (8689B)
a ´iN.ã@s€dZddlmZmZddlZddlZddlZddlZddlZddl Z ddl m Z dd„Z Gdd „d e j ƒZd d „Zdd d „ZdS)z Main program for 2to3. é)Úwith_statementÚprint_functionNé)Úrefactorc Cs(| ¡}| ¡}tj||||dddd�S)z%Return a unified diff of two strings.z (original)z (refactored)Ú)Zlineterm)Ú splitlinesÚdifflibZ unified_diff)ÚaÚbÚfilename©r ú$/usr/lib64/python3.9/lib2to3/main.pyÚ diff_textss  þrcs>eZdZdZd ‡fdd„ Zdd„Z‡fdd„Zd d „Z‡ZS) ÚStdoutRefactoringToola2 A refactoring tool that can avoid overwriting its input files. Prints output to stdout. Output files can optionally be written to a different directory and or have an extra file suffix appended to their name for use in situations where you do not want to replace the input files. rc sP||_||_|r&| tj¡s&|tj7}||_||_||_tt |ƒ  |||¡dS)aF Args: fixers: A list of fixers to import. options: A dict with RefactoringTool configuration. explicit: A list of fixers to run even if they are explicit. nobackups: If true no backup '.bak' files will be created for those files that are being refactored. show_diffs: Should diffs of the refactoring be printed to stdout? input_base_dir: The base directory for all input files. This class will strip this path prefix off of filenames before substituting it with output_dir. Only meaningful if output_dir is supplied. All files processed by refactor() must start with this path. output_dir: If supplied, all converted files will be written into this directory tree instead of input_base_dir. append_suffix: If supplied, all files output by this tool will have this appended to their filename. Useful for changing .py to .py3 for example by passing append_suffix='3'. N) Ú nobackupsÚ show_diffsÚendswithÚosÚsepÚ_input_base_dirÚ _output_dirÚ_append_suffixÚsuperrÚ__init__) ÚselfZfixersÚoptionsÚexplicitrrÚinput_base_dirÚ output_dirÚ append_suffix©Ú __class__r r r$s zStdoutRefactoringTool.__init__cOs0|j |||f¡|jj|g|¢Ri|¤ŽdS)N)ÚerrorsÚappendÚloggerÚerror)rÚmsgÚargsÚkwargsr r r Ú log_errorAszStdoutRefactoringTool.log_errorc sZ|}|jrH| |j¡r6tj |j|t|jƒd…¡}ntd||jfƒ‚|jrX||j7}||kr”tj  |¡}tj  |¡s†|r†t  |¡|  d||¡|j �s|d}tj |¡rÞzt |¡WntyÜ|  d|¡Yn0zt ||¡Wn"t�y|  d||¡Yn0tt|ƒj}|||||ƒ|j �s@t ||¡||k�rVt ||¡dS)Nz5filename %s does not start with the input_base_dir %szWriting converted %s to %s.z.bakzCan't remove backup %szCan't rename %s to %s)rÚ startswithrrÚpathÚjoinÚlenÚ ValueErrorrÚdirnameÚisdirÚmakedirsÚ log_messagerÚlexistsÚremoveÚOSErrorÚrenamerrÚ write_fileÚshutilÚcopymode) rZnew_textr Zold_textÚencodingZ orig_filenamerZbackupÚwriter r r r7EsH  ÿÿÿ   ÿ     z StdoutRefactoringTool.write_filecCs¼|r| d|¡n¦| d|¡|jr¸t|||ƒ}zd|jdur€|j�,|D] }t|ƒqHtj ¡Wdƒq’1st0Yn|D] }t|ƒq„Wn"ty¶t d|fƒYdS0dS)NzNo changes to %sz Refactored %sz+couldn't encode %s's diff for your terminal) r2rrZ output_lockÚprintÚsysÚstdoutÚflushÚUnicodeEncodeErrorÚwarn)rÚoldÚnewr ZequalZ diff_linesÚliner r r Ú print_outputls$    * ÿz"StdoutRefactoringTool.print_output)rrr) Ú__name__Ú __module__Ú __qualname__Ú__doc__rr)r7rEÚ __classcell__r r r r rs  ÿ 'rcCstd|ftjd�dS)Nz WARNING: %s©Úfile)r<r=Ústderr)r&r r r rA�srAc s tjdd�}|jddddd�|jdd d gd d �|jd dddddd�|jddd gdd �|jddddd�|jddddd�|jddddd�|jd d!dd"d�|jd#dd$d�|jd%d&dd'd�|jd(d)dd*d+d �|jd,d-dd.d/d0d1�|jd2d3dd4d�|jd5dd.d/d6d1�d*}i}| |¡\}}|j�rRd7|d8<|j�sLtd9ƒd7|_|j�rl|j�sl|  d:¡|j �r†|j�s†|  d;¡|j�sž|j �ržtd<ƒ|j�s¸|j�r¸|  d=¡|j �rìt d>ƒt ˆ¡D]}t |ƒ�qÒ|�sìd?S|�st d@tjdA�t dBtjdA�dCSdD|v�r:d7}|j�r:t dEtjdA�dCS|j�rJd7|dF<|j�rZd7|dG<|j�rhtjntj}tjdH|dI�t dJ¡}tt ˆ¡ƒ} t‡fdKdL„|jDƒƒ} tƒ} |j�rd*} |jD](} | dMk�rØd7} n|  ˆdN| ¡�qÄ| �rþ|  | ¡n| }n |  | ¡}|  | ¡}t!j" #|¡}|�rR| $t!j%¡�sRt!j" &|¡�sRt!j" '|¡}|j�rv| (t!j%¡}| )dO|j|¡t*t+|ƒ|t+| ƒ|j|j ||j|j dP�}|j,�s|�r¸| -¡nRz| ||j|j.|j/¡Wn6tj0�y|j/dk�sôJ‚t dQtjdA�YdS0| 1¡t2t3|j,ƒƒS)RzþMain program. Args: fixer_pkg: the name of a package where the fixers are located. args: optional; a list of command line arguments. If omitted, sys.argv[1:] is used. Returns a suggested exit status (0, 1, 2). z2to3 [options] file|dir ...)Úusagez-dz--doctests_onlyÚ store_truezFix up doctests only)ÚactionÚhelpz-fz--fixr#z1Each FIX specifies a transformation; default: all)rPÚdefaultrQz-jz --processesÚstorerÚintzRun 2to3 concurrently)rPrRÚtyperQz-xz--nofixz'Prevent a transformation from being runz-lz --list-fixeszList available transformationsz-pz--print-functionz0Modify the grammar so that print() is a functionz-ez--exec-functionz/Modify the grammar so that exec() is a functionz-vz --verbosezMore verbose loggingz --no-diffsz#Don't show diffs of the refactoringz-wz--writezWrite back modified filesz-nz --nobackupsFz&Don't write backups for modified filesz-oz --output-dirÚstrrzXPut output files in this directory instead of overwriting the input files. Requires -n.)rPrUrRrQz-Wz--write-unchanged-fileszYAlso write files even if no changes were required (useful with --output-dir); implies -w.z --add-suffixzuAppend this string to all output filenames. Requires -n if non-empty. ex: --add-suffix='3' will generate .py3 files.TÚwrite_unchanged_filesz&--write-unchanged-files/-W implies -w.z%Can't use --output-dir/-o without -n.z"Can't use --add-suffix without -n.z@not writing files and not printing diffs; that's not very usefulzCan't use -n without -wz2Available transformations for the -f/--fix option:rz1At least one file or directory argument required.rKzUse --help to show usage.éú-zCan't write to stdin.rÚ exec_functionz%(name)s: %(message)s)ÚformatÚlevelz lib2to3.mainc3s|]}ˆd|VqdS)ú.fix_Nr )Ú.0Úfix©Ú fixer_pkgr r Ú âózmain..Úallr]z7Output in %r will mirror the input directory %r layout.)rrrz+Sorry, -j isn't supported on this platform.)4ÚoptparseZ OptionParserZ add_optionÚ parse_argsrWr;rArrr%Z add_suffixZno_diffsZ list_fixesr<rZget_all_fix_namesr=rMrrZÚverboseÚloggingÚDEBUGÚINFOÚ basicConfigÚ getLoggerÚsetZget_fixers_from_packageZnofixr_ÚaddÚunionÚ differencerr+Ú commonprefixrrr0r/ÚrstripÚinforÚsortedr"Úrefactor_stdinZ doctests_onlyÚ processesZMultiprocessingUnsupportedZ summarizerTÚbool)rar'ÚparserruÚflagsrZfixnamer\r$Z avail_fixesZunwanted_fixesrZ all_presentr_Z requestedZ fixer_namesrZrtr r`r Úmain…sú  ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿÿ ÿ ÿ ÿ ÿ ÿ            ÿ  ÿ û ÿÿrz)N)rIZ __future__rrr=rrrhr8rerrrZMultiprocessRefactoringToolrrArzr r r r Ús  g