-
Notifications
You must be signed in to change notification settings - Fork 150
Rope Refactorings
The rope library provides a lot of tools to perform refactorings.
Emacs-for-python will automatically open Rope projects in the current (.) and upper (..) directory.
If you havent created a rope project for your Python sources yet do it with C-x p o.
Thats also the shortcut for opening a project.
- C-x p o - open rope project
- C-x p f - find file in rope project
- C-c d - python doc for module / method
- C-c g - goto definition
- C-c f - find occurencies
- C-c r r - refactoring rename
for more shortcuts have a look at https://bitbucket.org/agr/rope/src/c4df5fe957fd/docs/overview.txt
Renaming in ropemacs is quite intelligent all you have to do is to use it. All the renaming performed are project-wise and you can perform a rename on a lot of things:
- variables
- attributes
- keyword parameters
- modules
more info about actual examples: https://bitbucket.org/agr/rope/src/c4df5fe957fd/docs/overview.txt
Renaming renames method between the same class, Moving delegates the method/attribute to another class that's a component of the first.
A pep-8 formatting utility
It analyze the project and substitutes the function where it is usable, like
pow(a,b): return a**b
a**b -> it will be substituted automatically
if a**b is in another package it will import and substitute
It will move file accordingly
Have to describe it and to tune it up by default, otherwise it's almost unuseful
Complex stuff