-
-
Save jgarte/d08b60af9917089d582d6896d0921a9a to your computer and use it in GitHub Desktop.
Basic programmatic use of rope
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rope.base import libutils | |
import rope.base.project | |
from rope.refactor.rename import Rename | |
project = rope.base.project.Project('.') | |
resource = libutils.path_to_resource(project, './sample.py') | |
renamer = Rename(project, resource, 81) # offset=81 | |
changes = renamer.get_changes('Fnord') | |
project.do(changes) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment