Copy Undo over from apptools#813
Conversation
Codecov Report
@@ Coverage Diff @@
## master #813 +/- ##
==========================================
+ Coverage 40.81% 41.25% +0.43%
==========================================
Files 508 522 +14
Lines 27845 28110 +265
Branches 4219 4251 +32
==========================================
+ Hits 11366 11596 +230
- Misses 15999 16018 +19
- Partials 480 496 +16
Continue to review full report at Codecov.
|
|
|
||
| # This is the currently active command stack and may be None. Typically it | ||
| # is set when some sort of editor becomes active. | ||
| active_stack = Instance("apptools.undo.api.ICommandStack") |
There was a problem hiding this comment.
not sure why we can't just import and use ICommandStack here instead of using the string.
There was a problem hiding this comment.
There is a circular import, I think - UndoManager references ICommandStack and vice-versa.
|
|
||
| # This is the currently active command stack and may be None. Typically it | ||
| # is set when some sort of editor becomes active. | ||
| active_stack = Instance("apptools.undo.api.ICommandStack") |
There was a problem hiding this comment.
It looks like IUndoManager and ICommandStack depend on one another - which is why we can't import and use ICommandStack here. Can you add a comment here regarding the same?
|
|
||
|
|
||
| .. _API: api/index.html | ||
| .. _example: https://svn.enthought.com/enthought/browser/AppTools/trunk/examples/undo/ |
There was a problem hiding this comment.
This link is clearly out of place here, but I believe it was actually previously broken on apptools as well. Likewise, this final section of "API Overview" seems unnecessary with auto built api docs. This file needs to be updated, but I think I will leave those changes for a separate PR unless a reviewer would like to see them done here, in which case I am happy to do so
There was a problem hiding this comment.
Let's get them fixed in this PR instead of after the PR.
Here is a screenshot of the coverage report: Some of these would benefit from additional tests (looks like |
Can you add those as part of this PR? IMO its not too much to review. |
…is is all available in auto generated api docs). Also remove broken links
|
One thing I see that may be beneficial is |
rahulporuri
left a comment
There was a problem hiding this comment.
Mostly LGTM with a few minor comments.
|
|
||
| # Enthought library imports. | ||
| from pyface.api import GUI, YES | ||
| from pyface.workbench.api import Workbench |
There was a problem hiding this comment.
can you open an issue regd porting the undo example code from pyface workbench to pyface tasks?
Co-authored-by: Poruri Sai Rahul <rporuri@enthought.com>
|
@aaronayres35 before you merge, can you update the coverage report? |


As mentioned in step 6a of https://github.com/enthought/ets/blob/master/docs/source/eeps/eep-6.rst
this PR simply copies over the
apptools.undosubpackage from apptools (and updates references to apptools in the code to reference pyface instead).After the next pyface release we will want to deprecate
apptools.undoin apptools.