Plugin_Refactoring_Rope.RefactoringRope.Refactoring

Module implementing the refactoring interface to rope.

Classes

Refactoring Class implementing the refactoring interface to rope.

Functions

None


Refactoring

Class implementing the refactoring interface to rope.

Derived from

QObject

Methods

Refactoring Constructor
__canRedo Private slot to check, if there are changes to be redone.
__canRedoFile Private slot to check, if there are redoable changes for a resource.
__canUndo Private slot to check, if there are changes to be undone.
__canUndoFile Private slot to check, if there are undoable changes for a resource.
__changeOccurrences Private slot to perform the Change Occurrenses refactoring.
__changeSignature Private slot to change the signature of a method or function.
__clearHistory Private slot to clear the redo and undo lists.
__configChanged Private slot called, when the rope config file has changed.
__convertLocalToAttribute Private slot to convert a local variable to an attribute.
__defaultConfig Private slot to return the contents of rope's default configuration.
__doExtract Private method to perform the extract refactoring.
__doImports Private method to perform the various imports refactorings.
__doRename Private method to perform the various renaming refactorings.
__editConfig Private slot to open the rope configuration file in an editor.
__encapsulateAttribute Private slot to encapsulate an attribute.
__extractLocalVariable Private slot to handle the Extract Local Variable action.
__extractMethod Private slot to handle the Extract Method action.
__findAllErrors Private method to find bad names and attribute accesses in all files of the project.
__findErrors Private method to find bad names and attribute accesses in the current file.
__getFileRedoList Private slot to get a list of redoable changes.
__getFileUndoList Private slot to get a list of undoable changes.
__importsExpandStar Private slot to expand star imports.
__importsFromToImport Private slot to transform from imports to plain imports.
__importsHandleLong Private slot to handle long imports.
__importsOrganize Private slot to organize imports.
__importsRelativeToAbsolute Private slot to transform relative to absolute imports.
__inline Private slot to handle the Inline Local Variable action.
__inlineArgumentDefault Private slot to inline the default value of a parameter of a method or function.
__introduceFactoryMethod Private slot to introduce a factory method or global function.
__introduceParameter Private slot to introduce a parameter in a function.
__methodToMethodObject Private slot to change the signature of a method or function.
__moveMethod Private slot to handle the Move Method action.
__moveModule Private slot to handle the Move Current Module action.
__performSOA Private slot to perform SOA on all modules.
__queryDefinition Private slot to handle the Find Definition action
__queryImplementations Private slot to handle the Find Implementations action.
__queryReferences Private slot to handle the Find References action.
__redo Private slot to redo the last refactoring.
__rename Private slot to handle the Rename action.
__renameLocal Private slot to handle the Local Rename action.
__renameModule Private slot to handle the Rename Current Module action.
__restructure Private slot to restructure code.
__ropeConfigFile Private method to get the name of the rope configuration file.
__ropeInfo Private slot to show some info about rope.
__showFileRedoHistory Private method to show list of changes related to the current file available for a redo operation.
__showFileUndoHistory Private method to show list of changes related to the current file available for an undo operation.
__showProjectRedoHistory Private method to show list of changes available for a redo operation.
__showProjectUndoHistory Private method to show list of changes available for an undo operation.
__showRefactoringHistoryMenu Private slot called before the refactoring history menu is shown.
__showRefactoringMenu Private slot called before the refactoring menu is shown.
__showRopeHelp Private slot to show help about the refactorings offered by Rope.
__transformModuleToPackage Private slot to transform a module to a package.
__undo Private slot to undo the last refactoring.
__updateConfig Private slot to update the configuration file.
__useFunction Private slot to use a function wherever possible.
confirmAllBuffersSaved Private method to check, if any editor has unsaved changes.
confirmBufferIsSaved Private method to check, if an editor has unsaved changes.
getActions Public method to get a list of all actions.
getProject Public method to get a reference to the rope project object.
handleRopeError Public slot to handle a rope error.
initActions Public method to define the refactoring actions.
initMenu Public slot to initialize the refactoring menu.
projectClosed Public slot to handle the projectClosed signal.
projectOpened Public slot to handle the projectOpened signal.
refreshEditors Public method to refresh modified editors.

Refactoring (Constructor)

Refactoring(plugin, parent = None)

Constructor

plugin
reference to the plugin object
parent
parent (QObject)

Refactoring.__canRedo

__canRedo()

Private slot to check, if there are changes to be redone.

Returns:
flag indicating, that redoable changes are available (boolean)

Refactoring.__canRedoFile

__canRedoFile(resource)

Private slot to check, if there are redoable changes for a resource.

resource
file resource to check against (rope.base.resources.File)
Returns:
flag indicating, that redoable changes are available (boolean)

Refactoring.__canUndo

__canUndo()

Private slot to check, if there are changes to be undone.

Returns:
flag indicating, that undoable changes are available (boolean)

Refactoring.__canUndoFile

__canUndoFile(resource)

Private slot to check, if there are undoable changes for a resource.

resource
file resource to check against (rope.base.resources.File)
Returns:
flag indicating, that undoable changes are available (boolean)

Refactoring.__changeOccurrences

__changeOccurrences()

Private slot to perform the Change Occurrenses refactoring.

Refactoring.__changeSignature

__changeSignature()

Private slot to change the signature of a method or function.

Refactoring.__clearHistory

__clearHistory()

Private slot to clear the redo and undo lists.

Refactoring.__configChanged

__configChanged()

Private slot called, when the rope config file has changed.

Refactoring.__convertLocalToAttribute

__convertLocalToAttribute()

Private slot to convert a local variable to an attribute.

Refactoring.__defaultConfig

__defaultConfig()

Private slot to return the contents of rope's default configuration.

Returns:
string contain the source of rope's default configuration (string)

Refactoring.__doExtract

__doExtract(title, kind)

Private method to perform the extract refactoring.

title
title of the refactoring (QString)
kind
kind of extraction to be done (string, "method" or "variable")

Refactoring.__doImports

__doImports(title, method)

Private method to perform the various imports refactorings.

Refactoring.__doRename

__doRename(title, isLocal = False, renameModule = False)

Private method to perform the various renaming refactorings.

title
title of the refactoring (QString)
isLocal
flag indicating to restrict refactoring to the local file (boolean)
renameModule
flag indicating a module rename refactoring (boolean)

Refactoring.__editConfig

__editConfig()

Private slot to open the rope configuration file in an editor.

Refactoring.__encapsulateAttribute

__encapsulateAttribute()

Private slot to encapsulate an attribute.

Refactoring.__extractLocalVariable

__extractLocalVariable()

Private slot to handle the Extract Local Variable action.

Refactoring.__extractMethod

__extractMethod()

Private slot to handle the Extract Method action.

Refactoring.__findAllErrors

__findAllErrors()

Private method to find bad names and attribute accesses in all files of the project.

Refactoring.__findErrors

__findErrors()

Private method to find bad names and attribute accesses in the current file.

Refactoring.__getFileRedoList

__getFileRedoList(resource)

Private slot to get a list of redoable changes.

resource
file resource to filter against (rope.base.resources.File)
Returns:
list of change objects (list of rope.base.change.Change)

Refactoring.__getFileUndoList

__getFileUndoList(resource)

Private slot to get a list of undoable changes.

resource
file resource to filter against (rope.base.resources.File)
Returns:
list of change objects (list of rope.base.change.Change)

Refactoring.__importsExpandStar

__importsExpandStar()

Private slot to expand star imports.

Refactoring.__importsFromToImport

__importsFromToImport()

Private slot to transform from imports to plain imports.

Refactoring.__importsHandleLong

__importsHandleLong()

Private slot to handle long imports.

Refactoring.__importsOrganize

__importsOrganize()

Private slot to organize imports.

Refactoring.__importsRelativeToAbsolute

__importsRelativeToAbsolute()

Private slot to transform relative to absolute imports.

Refactoring.__inline

__inline()

Private slot to handle the Inline Local Variable action.

Refactoring.__inlineArgumentDefault

__inlineArgumentDefault()

Private slot to inline the default value of a parameter of a method or function.

Refactoring.__introduceFactoryMethod

__introduceFactoryMethod()

Private slot to introduce a factory method or global function.

Refactoring.__introduceParameter

__introduceParameter()

Private slot to introduce a parameter in a function.

Refactoring.__methodToMethodObject

__methodToMethodObject()

Private slot to change the signature of a method or function.

Refactoring.__moveMethod

__moveMethod()

Private slot to handle the Move Method action.

Refactoring.__moveModule

__moveModule()

Private slot to handle the Move Current Module action.

Refactoring.__performSOA

__performSOA()

Private slot to perform SOA on all modules.

Refactoring.__queryDefinition

__queryDefinition()

Private slot to handle the Find Definition action

Refactoring.__queryImplementations

__queryImplementations()

Private slot to handle the Find Implementations action.

Refactoring.__queryReferences

__queryReferences()

Private slot to handle the Find References action.

Refactoring.__redo

__redo()

Private slot to redo the last refactoring.

Refactoring.__rename

__rename()

Private slot to handle the Rename action.

Refactoring.__renameLocal

__renameLocal()

Private slot to handle the Local Rename action.

Refactoring.__renameModule

__renameModule()

Private slot to handle the Rename Current Module action.

Refactoring.__restructure

__restructure()

Private slot to restructure code.

Refactoring.__ropeConfigFile

__ropeConfigFile()

Private method to get the name of the rope configuration file.

Returns:
name of the rope configuration file (string)

Refactoring.__ropeInfo

__ropeInfo()

Private slot to show some info about rope.

Refactoring.__showFileRedoHistory

__showFileRedoHistory()

Private method to show list of changes related to the current file available for a redo operation.

Refactoring.__showFileUndoHistory

__showFileUndoHistory()

Private method to show list of changes related to the current file available for an undo operation.

Refactoring.__showProjectRedoHistory

__showProjectRedoHistory()

Private method to show list of changes available for a redo operation.

Refactoring.__showProjectUndoHistory

__showProjectUndoHistory()

Private method to show list of changes available for an undo operation.

Refactoring.__showRefactoringHistoryMenu

__showRefactoringHistoryMenu()

Private slot called before the refactoring history menu is shown.

Refactoring.__showRefactoringMenu

__showRefactoringMenu()

Private slot called before the refactoring menu is shown.

Refactoring.__showRopeHelp

__showRopeHelp()

Private slot to show help about the refactorings offered by Rope.

Refactoring.__transformModuleToPackage

__transformModuleToPackage()

Private slot to transform a module to a package.

Refactoring.__undo

__undo()

Private slot to undo the last refactoring.

Refactoring.__updateConfig

__updateConfig()

Private slot to update the configuration file.

Refactoring.__useFunction

__useFunction()

Private slot to use a function wherever possible.

Refactoring.confirmAllBuffersSaved

confirmAllBuffersSaved()

Private method to check, if any editor has unsaved changes.

Refactoring.confirmBufferIsSaved

confirmBufferIsSaved(editor)

Private method to check, if an editor has unsaved changes.

editor
Reference to the editor to be checked.

Refactoring.getActions

getActions()

Public method to get a list of all actions.

Returns:
list of all actions (list of E4Action)

Refactoring.getProject

getProject()

Public method to get a reference to the rope project object.

Returns:
reference to the rope project object (rope.base.project.Project)

Refactoring.handleRopeError

handleRopeError(err, title, handle = None)

Public slot to handle a rope error.

err
rope exception object (Exception)
title
title to be displayed (string or QString)
handle
reference to a taskhandle (ProgressHandle)

Refactoring.initActions

initActions()

Public method to define the refactoring actions.

Refactoring.initMenu

initMenu()

Public slot to initialize the refactoring menu.

Returns:
the menu generated (QMenu)

Refactoring.projectClosed

projectClosed()

Public slot to handle the projectClosed signal.

Refactoring.projectOpened

projectOpened()

Public slot to handle the projectOpened signal.

Refactoring.refreshEditors

refreshEditors(changes)

Public method to refresh modified editors.

reference
to the Changes object (rope.base.change.ChangeSet)
Up