rope.refactor.sourceutils

Functions

get_indents(lines, lineno)

find_minimum_indents(source_code)

indent_lines(source_code, amount)

fix_indentation(code, new_indents) → str

Change the indentation of code to new_indents

add_methods(pymodule, class_scope, methods_sources)

get_body(pyfunction)

Return unindented function body

get_body_region(defined)

Return the start and end offsets of function body

get_indent(project)

Module Contents

rope.refactor.sourceutils.get_indents(lines, lineno)
rope.refactor.sourceutils.find_minimum_indents(source_code)
rope.refactor.sourceutils.indent_lines(source_code, amount)
rope.refactor.sourceutils.fix_indentation(code: str, new_indents: int) → str

Change the indentation of code to new_indents

rope.refactor.sourceutils.add_methods(pymodule, class_scope, methods_sources)
rope.refactor.sourceutils.get_body(pyfunction)

Return unindented function body

rope.refactor.sourceutils.get_body_region(defined)

Return the start and end offsets of function body

rope.refactor.sourceutils.get_indent(project)