Created
October 11, 2017 06:32
-
-
Save abingham/ddb0e52c1a8017c64d72c14d51ef0129 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