Module Expr Str ImportFrom alias Import alias Import alias Import alias Import alias Import alias Import alias ImportFrom alias FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Str Str keyword Str decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Str Str Str body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad If BoolOpAnd NameLoad UnaryOpNot Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr body AugAssignAdd NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults vararg kwarg body Expr Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore NameLoad If AttributeLoad NameLoad attr body If Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice Call NameLoad AttributeLoad NameLoad attr orelse Raise Call NameLoad BinOpMod Str TupleLoad NameLoad AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body AugAssignAdd NameStore AttributeLoad NameLoad attr If CompareNotEq NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad If UnaryOpNot AttributeLoad NameLoad attr body Assign NameStore BinOpAdd NameLoad Str If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr name NameStore body Expr Call AttributeLoad NameLoad attr Str NameLoad TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr name NameStore body Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad Assign NameStore AttributeLoad Call NameLoad NameLoad NameLoad attr Expr Call NameLoad NameLoad NameLoad NameLoad NameLoad If UnaryOpNot AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareNotEq NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body If NameLoad body Expr Call AttributeLoad NameLoad attr Str NameLoad orelse Expr Call AttributeLoad NameLoad attr Str NameLoad If AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad NameLoad NameLoad TryExcept body If CompareIsNot AttributeLoad NameLoad attr NameLoad body With AttributeLoad NameLoad attr body For NameStore NameLoad body Print NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr orelse For NameStore NameLoad body Print NameLoad handlers ExceptHandler type NameLoad body Expr Call NameLoad BinOpMod Str TupleLoad NameLoad Return decorator_list decorator_list FunctionDef arguments args NameParam defaults body Print AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword ListLoad keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Num keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword ListLoad keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword Str keyword Str Assign NameStore NameLoad Assign NameStore Dict Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad If AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index Str NameLoad If UnaryOpNot AttributeLoad NameLoad attr body Expr Call NameLoad Str Assign AttributeStore NameLoad attr NameLoad If BoolOpAnd AttributeLoad NameLoad attr UnaryOpNot AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str If BoolOpAnd AttributeLoad NameLoad attr UnaryOpNot AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str If BoolOpAnd UnaryOpNot AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call NameLoad Str If BoolOpAnd UnaryOpNot AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str If AttributeLoad NameLoad attr body Print Str For NameStore Call AttributeLoad NameLoad attr NameLoad body Print NameLoad If UnaryOpNot NameLoad body Return Num If UnaryOpNot NameLoad body Print AttributeLoad NameLoad attr Str Print AttributeLoad NameLoad attr Str Return Num If CompareIn Str NameLoad body Assign NameStore NameLoad If AttributeLoad NameLoad attr body Print AttributeLoad NameLoad attr Str Return Num If AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index Str NameLoad Assign NameStore IfExp AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr keyword Str keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad GeneratorExp BinOpAdd BinOpAdd NameLoad Str NameLoad comprehension NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad If AttributeLoad NameLoad attr body Assign NameStore NameLoad For NameStore AttributeLoad NameLoad attr body If CompareEq NameLoad Str body Assign NameStore NameLoad orelse Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd NameLoad Str NameLoad Assign NameStore IfExp NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If BoolOpAnd NameLoad UnaryOpNot Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad Call NameLoad NameLoad NameLoad Call NameLoad NameLoad AttributeLoad NameLoad attr UnaryOpNot AttributeLoad NameLoad attr keyword NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr If UnaryOpNot AttributeLoad NameLoad attr body If NameLoad body Expr Call AttributeLoad NameLoad attr orelse TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr handlers ExceptHandler type AttributeLoad NameLoad attr body Assert CompareGt AttributeLoad NameLoad attr Num Print AttributeLoad NameLoad attr Str Return Num Expr Call AttributeLoad NameLoad attr Return Call NameLoad Call NameLoad AttributeLoad NameLoad attr decorator_list
N/A N/A 
Main program for 2to3.
 __future__ with_statement N/A sys N/A os N/A difflib N/A logging N/A shutil N/A optparse N/A refactor diff_texts N/A N/A a b filename N/A N/A N/A Return a unified diff of two strings. N/A a N/A N/A a splitlines N/A b N/A N/A b splitlines N/A N/A N/A difflib unified_diff a b filename filename (original) (refactored) lineterm N/A StdoutRefactoringTool N/A N/A refactor MultiprocessRefactoringTool N/A N/A 
    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.
     __init__ N/A N/A self fixers options explicit nobackups show_diffs input_base_dir output_dir append_suffix N/A N/A N/A 
        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/A N/A self nobackups nobackups N/A N/A self show_diffs show_diffs N/A N/A input_base_dir N/A N/A N/A input_base_dir endswith N/A os sep N/A N/A input_base_dir N/A os sep N/A N/A self _input_base_dir input_base_dir N/A N/A self _output_dir output_dir N/A N/A self _append_suffix append_suffix N/A N/A N/A N/A super StdoutRefactoringTool self __init__ fixers options explicit N/A log_error N/A N/A self msg N/A args kwargs N/A N/A N/A N/A N/A self errors append N/A msg args kwargs N/A N/A N/A N/A self logger error msg args kwargs N/A write_file N/A N/A self new_text filename old_text encoding N/A N/A N/A orig_filename filename N/A N/A self _output_dir N/A N/A N/A N/A filename startswith N/A self _input_base_dir N/A N/A filename N/A N/A N/A os path join N/A self _output_dir N/A filename N/A N/A len N/A self _input_base_dir N/A N/A N/A ValueError N/A filename %s does not start with the input_base_dir %s N/A filename N/A self _input_base_dir N/A N/A self _append_suffix N/A N/A filename N/A self _append_suffix N/A N/A orig_filename filename N/A N/A output_dir N/A N/A N/A os path dirname filename N/A N/A N/A N/A N/A os path isdir output_dir N/A N/A N/A N/A os makedirs output_dir N/A N/A N/A self log_message Writing converted %s to %s. orig_filename filename N/A N/A N/A self nobackups N/A N/A backup N/A filename .bak N/A N/A N/A N/A os path lexists backup N/A N/A N/A N/A N/A N/A os remove backup N/A N/A N/A N/A os error N/A err N/A N/A N/A N/A self log_message Can't remove backup %s backup N/A N/A N/A N/A N/A os rename filename backup N/A N/A N/A N/A os error N/A err N/A N/A N/A N/A self log_message Can't rename %s to %s filename backup N/A write N/A N/A super StdoutRefactoringTool self write_file N/A N/A write new_text filename old_text encoding N/A N/A N/A self nobackups N/A N/A N/A N/A shutil copymode backup filename N/A N/A orig_filename filename N/A N/A N/A N/A shutil copymode orig_filename filename N/A print_output N/A N/A self old new filename equal N/A N/A N/A equal N/A N/A N/A N/A self log_message No changes to %s filename N/A N/A N/A N/A self log_message Refactored %s filename N/A N/A self show_diffs N/A N/A diff_lines N/A diff_texts old new filename N/A N/A N/A N/A N/A self output_lock None N/A N/A N/A self output_lock N/A N/A line diff_lines N/A N/A line N/A N/A N/A N/A sys stdout flush N/A N/A line diff_lines N/A N/A line N/A N/A N/A UnicodeEncodeError N/A N/A N/A warn N/A couldn't encode %s's diff for your terminal N/A filename N/A N/A N/A warn N/A N/A msg N/A N/A N/A N/A sys stderr N/A WARNING: %s N/A msg N/A main N/A N/A fixer_pkg args N/A None N/A N/A 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).
     N/A parser N/A N/A optparse OptionParser usage 2to3 [options] file|dir ... N/A N/A N/A parser add_option -d --doctests_only action store_true help Fix up doctests only N/A N/A N/A parser add_option -f --fix action append default N/A help Each FIX specifies a transformation; default: all N/A N/A N/A parser add_option -j --processes action store default 1 type int help Run 2to3 concurrently N/A N/A N/A parser add_option -x --nofix action append default N/A help Prevent a transformation from being run N/A N/A N/A parser add_option -l --list-fixes action store_true help List available transformations N/A N/A N/A parser add_option -p --print-function action store_true help Modify the grammar so that print() is a function N/A N/A N/A parser add_option -v --verbose action store_true help More verbose logging N/A N/A N/A parser add_option --no-diffs action store_true help Don't show diffs of the refactoring N/A N/A N/A parser add_option -w --write action store_true help Write back modified files N/A N/A N/A parser add_option -n --nobackups action store_true default False help Don't write backups for modified files N/A N/A N/A parser add_option -o --output-dir action store type str default help Put output files in this directory instead of overwriting the input files.  Requires -n. N/A N/A N/A parser add_option -W --write-unchanged-files action store_true help Also write files even if no changes were required (useful with --output-dir); implies -w. N/A N/A N/A parser add_option --add-suffix action store type str default help Append this string to all output filenames. Requires -n if non-empty.  ex: --add-suffix='3' will generate .py3 files. N/A refactor_stdin False N/A flags N/A N/A N/A options args N/A N/A parser parse_args args N/A N/A options write_unchanged_files N/A N/A N/A flags N/A write_unchanged_files True N/A N/A N/A options write N/A N/A N/A warn --write-unchanged-files/-W implies -w. N/A N/A options write True N/A N/A N/A options output_dir N/A N/A options nobackups N/A N/A N/A N/A parser error Can't use --output-dir/-o without -n. N/A N/A N/A options add_suffix N/A N/A options nobackups N/A N/A N/A N/A parser error Can't use --add-suffix without -n. N/A N/A N/A N/A options write N/A options no_diffs N/A N/A N/A warn not writing files and not printing diffs; that's not very useful N/A N/A N/A N/A options write N/A options nobackups N/A N/A N/A N/A parser error Can't use -n without -w N/A N/A options list_fixes N/A N/A Available transformations for the -f/--fix option: N/A fixname N/A N/A refactor get_all_fix_names fixer_pkg N/A N/A fixname N/A N/A args N/A N/A 0 N/A N/A args N/A N/A N/A sys stderr At least one file or directory argument required. N/A N/A sys stderr Use --help to show usage. N/A 2 N/A N/A - args N/A N/A refactor_stdin True N/A N/A options write N/A N/A N/A sys stderr Can't write to stdin. N/A 2 N/A N/A options print_function N/A N/A N/A flags N/A print_function True N/A level N/A N/A options verbose N/A logging DEBUG N/A logging INFO N/A N/A N/A logging basicConfig format %(name)s: %(message)s level level N/A logger N/A N/A logging getLogger lib2to3.main N/A avail_fixes N/A set N/A N/A refactor get_fixers_from_package fixer_pkg N/A unwanted_fixes N/A set N/A N/A N/A fixer_pkg .fix_ fix N/A fix N/A options nofix N/A explicit N/A set N/A N/A options fix N/A N/A all_present False N/A fix N/A options fix N/A N/A N/A fix all N/A N/A all_present True N/A N/A N/A N/A explicit add N/A N/A fixer_pkg .fix_ fix N/A requested N/A all_present N/A N/A avail_fixes union explicit explicit N/A N/A requested N/A N/A avail_fixes union explicit N/A fixer_names N/A N/A requested difference unwanted_fixes N/A input_base_dir N/A N/A N/A os path commonprefix args N/A N/A input_base_dir N/A N/A N/A input_base_dir endswith N/A os sep N/A N/A N/A N/A os path isdir input_base_dir N/A N/A input_base_dir N/A N/A N/A os path dirname input_base_dir N/A N/A options output_dir N/A N/A input_base_dir N/A N/A input_base_dir rstrip N/A os sep N/A N/A N/A logger info Output in %r will mirror the input directory %r layout. N/A options output_dir input_base_dir N/A rt N/A StdoutRefactoringTool N/A sorted fixer_names flags N/A sorted explicit N/A options nobackups N/A N/A options no_diffs input_base_dir input_base_dir output_dir N/A options output_dir append_suffix N/A options add_suffix N/A N/A N/A rt errors N/A N/A refactor_stdin N/A N/A N/A N/A rt refactor_stdin N/A N/A N/A N/A N/A N/A rt refactor args N/A options write N/A options doctests_only N/A options processes N/A N/A N/A N/A refactor MultiprocessingUnsupported N/A N/A N/A N/A options processes 1 N/A N/A sys stderr Sorry, -j isn't supported on this platform. N/A 1 N/A N/A N/A rt summarize N/A N/A int N/A bool N/A rt errors N/A