python (3.12.0)

(root)/
lib/
python3.12/
lib2to3/
__pycache__/
main.cpython-312.pyc

̑eN.dZddlmZmZddlZddlZddlZddlZddlZddl	Z	ddl
mZdZGddejZd	Zdd
Zy)z
Main program for 2to3.
)with_statementprint_functionN)refactorc	z|j}|j}tj||||dddS)z%Return a unified diff of two strings.z
(original)z(refactored))lineterm)
splitlinesdifflibunified_diff)abfilenames   @/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/lib2to3/main.py
diff_textsrs;	A	A1h ,n)+--c<eZdZdZ	dfd	ZdZfdZdZxZS)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.
    c	||_||_|r2|jtjs|tjz
}||_||_||_tt|+|||y)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_diffsendswithossep_input_base_dir_output_dir_append_suffixsuperr__init__)
selffixersoptionsexplicitrrinput_base_dir
output_dir
append_suffix	__class__s
         rrzStdoutRefactoringTool.__init__$sa(#$."9"9"&&"Abff$N-%+
#T3FGXNrc|jj|||f|jj|g|i|yN)errorsappendloggererror)r msgargskwargss    r	log_errorzStdoutRefactoringTool.log_errorAs9Cv./#///rc|}|jrw|j|jrAtjj|j|t
|jd}ntd|d|j|jr||jz
}||k7rhtjj|}tjj|s|rtj||jd|||jsQ|dz}tjj|r	tj|	tj"||t$t&|R}||||||jst+j,|||k7rt+j,||yy#t $r|jd|YwxYw#t $r|jd||YwxYw)Nz	filename z( does not start with the input_base_dir zWriting converted %s to %s.z.bakzCan't remove backup %szCan't rename %s to %s)r
startswithrrpathjoinlen
ValueErrorrdirnameisdirmakedirslog_messagerlexistsremoveOSErrorrenamerr
write_fileshutilcopymode)
r new_textrold_textencoding
orig_filenamer%backupwriter's
         rr@z StdoutRefactoringTool.write_fileEs 
""4#7#7877<<(8(8(0T5I5I1J1K(LN!)143G3G"IJJ+++HH$2J77==,J':M%
'~~&Fwwv&GIIf%
L		(F++T=
h(H5~~OOFH-H$OOM84%G$$%=vFG
L  !8(FK
Ls$GG%G"!G"%HHc|r|jd|y|jd||jrst|||}	|jF|j5|D]
}t	|t
jjdddy|D]
}t	|yy#1swYyxYw#t$rtd|dYywxYw)NzNo changes to %sz
Refactored %szcouldn't encode z's diff for your terminal)
r;rroutput_lockprintsysstdoutflushUnicodeEncodeErrorwarn)r oldnewrequal
diff_lineslines       rprint_outputz"StdoutRefactoringTool.print_outputls/:_h7'S(;
''3!--/(2, %d,JJ,,.//
%/(D!$K(//*"%&s6B41B(B4B4(B1-B41B44CC)rrr)	__name__
__module____qualname____doc__rr1r@rV
__classcell__)r's@rrrs%BDO:0%5Nrrc@td|tjy)Nz	WARNING: file)rKrLstderr)r.s rrPrPs	3
 szz2rc
tjd}|jdddd|jdd	d
gd|jd
ddddd|jddd
gd|jdddd|jdddd|jdddd|jd d!dd"|jd#dd$|jd%d&dd'|jd(d)dd*d+|jd,d-dd.d/d01|jd2d3dd4|jd5dd.d/d61d*}i}|j|\}}|jr#d7|d8<|j
st
d9d7|_|jr|js|jd:|jr|js|jd;|j
s|jrt
d<|j
s|jr|jd=|jr3td>tjD]
}t||sy?|s7td@t j"AtdBt j"AyCdD|vr*d7}|j
rtdEt j"AyC|j$rd7|dF<|j&rd7|dG<|j(rt*j,nt*j.}t+j0dH|It+j2dJ}t5tj6}	t5fdK|j8D}
t5}|j:rHd*}|j:D]!}
|
dLk(rd7}|j=dMz|
z#|r|	j?|n|}n|	j?|}|jA|
}tBjDjG|}|r]|jItBjJs>tBjDjM|stBjDjO|}|jr<|jQtBjJ}|jSdN|j|tUtW||tW||j|j||j|jO}|jXsV|r|j[n3	|j||j
|j\|j^|jctetg|jXS#tj`$r/|j^dkDsJtdPt j"AYywxYw)QzMain 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)actionhelpz-fz--fixr+z1Each FIX specifies a transformation; default: all)rcdefaultrdz-jz--processesstorerintzRun 2to3 concurrently)rcretyperdz-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-dirstrrzXPut output files in this directory instead of overwriting the input files.  Requires -n.)rcrhrerdz-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.Twrite_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.r]zUse --help to show usage.-zCan't write to stdin.r
exec_functionz%(name)s: %(message)s)formatlevelzlib2to3.mainc3.K|]}dz|zyw).fix_N).0fix	fixer_pkgs  r	<genexpr>zmain.<locals>.<genexpr>sLsW,s2Lsallrqz7Output in %r will mirror the input directory %r layout.)r$r%r&z+Sorry, -j isn't supported on this platform.)4optparseOptionParser
add_option
parse_argsrjrHrPr%rr-
add_suffixno_diffs
list_fixesrKrget_all_fix_namesrLr_rrmverboseloggingDEBUGINFObasicConfig	getLoggersetget_fixers_from_packagenofixrtaddunion
differencerr4commonprefixrrr9r8rstripinforsortedr*refactor_stdin
doctests_only	processesMultiprocessingUnsupported	summarizergbool)rur/parserrflagsr"fixnameror,avail_fixesunwanted_fixesr#all_presentrt	requestedfixer_namesr$rts`                 rmainrsv
"
")F
GF
d-l13
dGHbNP
dM'1 '>@
dIhDF
dN<;=
d.|MO
d-lLN
dK13
l<@B
dIl68
dM,CE
dN7 (NOd5lABnW5"GHNE%%d+MGT$$)-%&}}9:
'"3"3<='"3"39:==W--
OP==W.../
BC11)<	G'N	
A

S
)

;
d{==)

;"&!%o%__GMM',,E6eD


~
.Fh66yABKLgmmLLNuH{{;;	8Ce|"Y0367		8
4?K%%h/H	%%h/	&&~6KWW))$/N~66rvv>

n-8'..rvv6M&&	8	;x(87#3#33)))!,,
.B99
D'--1F1F#--/	tBII66
((1,,C::'	
s:2V?WWr))rZ
__future__rrrLrrrrArxrrrMultiprocessRefactoringToolrrPrrrrr<module>rsI6
	
-eH@@eN3L r