rope.base.change
Classes
The base class for changes |
|
A collection of Change objects |
|
A class to change the contents of a file |
|
Move a resource to a new location |
|
A class to create a resource |
|
A class to create a folder |
|
A class to create a file |
|
A class to remove a resource |
|
Functions
|
Counts the number of basic changes a Change will make |
|
Module Contents
- class rope.base.change.Change
The base class for changes
Rope refactorings return Change objects. They can be previewed, committed or undone.
- do(job_set=None)
Perform the change
Note
Do use this directly. Use Project.do() instead.
- undo(job_set=None)
Perform the change
Note
Do use this directly. Use History.undo() instead.
- get_description()
Return the description of this change
This can be used for previewing the changes.
- get_changed_resources()
Return the list of resources that will be changed
- class rope.base.change.ChangeSet(description, timestamp=None)
Bases:
ChangeA collection of Change objects
This class holds a collection of changes. This class provides these fields:
changes: the list of changes
description: the goal of these changes
- changes = []
- description
- time = None
- do(job_set=taskhandle.DEFAULT_JOB_SET)
Perform the change
Note
Do use this directly. Use Project.do() instead.
- undo(job_set=taskhandle.DEFAULT_JOB_SET)
Perform the change
Note
Do use this directly. Use History.undo() instead.
- add_change(change)
- get_description()
Return the description of this change
This can be used for previewing the changes.
- get_changed_resources()
Return the list of resources that will be changed
- class rope.base.change.ChangeContents(resource, new_contents, old_contents=None)
Bases:
ChangeA class to change the contents of a file
Fields:
resource: The rope.base.resources.File to change
new_contents: What to write in the file
- resource
- new_contents
- old_contents = None
- do()
Perform the change
Note
Do use this directly. Use Project.do() instead.
- undo()
Perform the change
Note
Do use this directly. Use History.undo() instead.
- get_description()
Return the description of this change
This can be used for previewing the changes.
- get_changed_resources()
Return the list of resources that will be changed
- class rope.base.change.MoveResource(resource, new_location, exact=False)
Bases:
ChangeMove a resource to a new location
Fields:
resource: The rope.base.resources.Resource to move
new_resource: The destination for move; It is the moved resource not the folder containing that resource.
- project
- resource
- do()
Perform the change
Note
Do use this directly. Use Project.do() instead.
- undo()
Perform the change
Note
Do use this directly. Use History.undo() instead.
- get_description()
Return the description of this change
This can be used for previewing the changes.
- get_changed_resources()
Return the list of resources that will be changed
- class rope.base.change.CreateResource(resource)
Bases:
ChangeA class to create a resource
Fields:
resource: The resource to create
- resource
- do()
Perform the change
Note
Do use this directly. Use Project.do() instead.
- undo()
Perform the change
Note
Do use this directly. Use History.undo() instead.
- get_description()
Return the description of this change
This can be used for previewing the changes.
- get_changed_resources()
Return the list of resources that will be changed
- class rope.base.change.CreateFolder(parent, name)
Bases:
CreateResourceA class to create a folder
See docs for CreateResource.
- resource
- do()
Perform the change
Note
Do use this directly. Use Project.do() instead.
- undo()
Perform the change
Note
Do use this directly. Use History.undo() instead.
- get_description()
Return the description of this change
This can be used for previewing the changes.
- get_changed_resources()
Return the list of resources that will be changed
- class rope.base.change.CreateFile(parent, name)
Bases:
CreateResourceA class to create a file
See docs for CreateResource.
- resource
- do()
Perform the change
Note
Do use this directly. Use Project.do() instead.
- undo()
Perform the change
Note
Do use this directly. Use History.undo() instead.
- get_description()
Return the description of this change
This can be used for previewing the changes.
- get_changed_resources()
Return the list of resources that will be changed
- class rope.base.change.RemoveResource(resource)
Bases:
ChangeA class to remove a resource
Fields:
resource: The resource to be removed
- resource
- do()
Perform the change
Note
Do use this directly. Use Project.do() instead.
- abstractmethod undo()
Perform the change
Note
Do use this directly. Use History.undo() instead.
- get_changed_resources()
Return the list of resources that will be changed
- get_description()
Return the description of this change
This can be used for previewing the changes.
- rope.base.change.count_changes(change)
Counts the number of basic changes a Change will make
- rope.base.change.create_job_set(task_handle, change)