diff --git a/docs/source/enable_apptools_integration.rst b/docs/source/enable_undo_redo.rst similarity index 92% rename from docs/source/enable_apptools_integration.rst rename to docs/source/enable_undo_redo.rst index 2ab9f6d0b..7427d5080 100644 --- a/docs/source/enable_apptools_integration.rst +++ b/docs/source/enable_undo_redo.rst @@ -1,24 +1,13 @@ -Enable Apptools Integration -=========================== - -Apptools (https://github.com/enthought/apptools) is a library of useful code -for building GUI applications. It includes code for features like preferences, -undo/redo support, and selection management. - -Enable doesn't require Apptools, but developers working within the apptools -ecosystem may want to integrate Enable interactions with undo/redo and -selections. - Undo/Redo Support ------------------ +================= -The `enable.tools.apptools` package has a number of modules that provide -classes for working with Apptool's Undo/Redo stack. This permits Enable +The `enable.tools.pyface` package has a number of modules that provide +classes for working with Pyface's Undo/Redo stack. This permits Enable tools to add Commands to the Undo/Redo stack, and provides variants of the MoveTool and ResizeTool that are undoable. In addition, a tool is provided which binds keystrokes to send undo and -redo requests to the apptools UndoManager. +redo requests to the Pyface UndoManager. High-Level Tools ~~~~~~~~~~~~~~~~ diff --git a/docs/source/index.rst b/docs/source/index.rst index ca6184089..a2b203773 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -9,7 +9,7 @@ Enable Documentation enable_key_events.rst enable_basic_tools.rst enable_drag_and_drop.rst - enable_apptools_integration.rst + enable_undo_redo.rst kiva.rst credits.rst diff --git a/enable/tests/tools/apptools/__init__.py b/enable/tests/tools/pyface/__init__.py similarity index 100% rename from enable/tests/tools/apptools/__init__.py rename to enable/tests/tools/pyface/__init__.py diff --git a/enable/tests/tools/apptools/test_commands.py b/enable/tests/tools/pyface/test_commands.py similarity index 99% rename from enable/tests/tools/apptools/test_commands.py rename to enable/tests/tools/pyface/test_commands.py index 30cd78d6e..3161fc5d4 100644 --- a/enable/tests/tools/apptools/test_commands.py +++ b/enable/tests/tools/pyface/test_commands.py @@ -15,7 +15,7 @@ # Local library imports from enable.component import Component from enable.testing import EnableTestAssistant -from enable.tools.apptools.commands import ( +from enable.tools.pyface.commands import ( ComponentCommand, MoveCommand, ResizeCommand) diff --git a/enable/tests/tools/apptools/test_move_command_tool.py b/enable/tests/tools/pyface/test_move_command_tool.py similarity index 96% rename from enable/tests/tools/apptools/test_move_command_tool.py rename to enable/tests/tools/pyface/test_move_command_tool.py index 50beafb15..6d3441e01 100644 --- a/enable/tests/tools/apptools/test_move_command_tool.py +++ b/enable/tests/tools/pyface/test_move_command_tool.py @@ -10,15 +10,15 @@ from unittest.mock import MagicMock # Enthought library imports -from apptools.undo.api import CommandStack +from pyface.undo.api import CommandStack from traits.testing.unittest_tools import UnittestTools # Local library imports from enable.component import Component from enable.container import Container from enable.testing import EnableTestAssistant -from enable.tools.apptools.commands import MoveCommand, ResizeCommand -from enable.tools.apptools.move_command_tool import MoveCommandTool +from enable.tools.pyface.commands import MoveCommand, ResizeCommand +from enable.tools.pyface.move_command_tool import MoveCommandTool class MoveCommandToolTestCase(unittest.TestCase, EnableTestAssistant, diff --git a/enable/tests/tools/apptools/test_resize_command_tool.py b/enable/tests/tools/pyface/test_resize_command_tool.py similarity index 95% rename from enable/tests/tools/apptools/test_resize_command_tool.py rename to enable/tests/tools/pyface/test_resize_command_tool.py index 466443160..2822f5052 100644 --- a/enable/tests/tools/apptools/test_resize_command_tool.py +++ b/enable/tests/tools/pyface/test_resize_command_tool.py @@ -10,15 +10,15 @@ from unittest.mock import MagicMock # Enthought library imports -from apptools.undo.api import CommandStack +from pyface.undo.api import CommandStack from traits.testing.unittest_tools import UnittestTools # Local library imports from enable.component import Component from enable.container import Container from enable.testing import EnableTestAssistant -from enable.tools.apptools.commands import ResizeCommand -from enable.tools.apptools.resize_command_tool import ResizeCommandTool +from enable.tools.pyface.commands import ResizeCommand +from enable.tools.pyface.resize_command_tool import ResizeCommandTool class ResizeCommandToolTestCase(unittest.TestCase, EnableTestAssistant, diff --git a/enable/tests/tools/apptools/test_undo_tool.py b/enable/tests/tools/pyface/test_undo_tool.py similarity index 96% rename from enable/tests/tools/apptools/test_undo_tool.py rename to enable/tests/tools/pyface/test_undo_tool.py index 84a800a86..2204e3e7f 100644 --- a/enable/tests/tools/apptools/test_undo_tool.py +++ b/enable/tests/tools/pyface/test_undo_tool.py @@ -10,14 +10,14 @@ from unittest.mock import MagicMock # Enthought library imports -from apptools.undo.api import UndoManager +from pyface.undo.api import UndoManager from traits.testing.unittest_tools import UnittestTools # Local library imports from enable.base_tool import KeySpec from enable.component import Component from enable.testing import EnableTestAssistant -from enable.tools.apptools.undo_tool import UndoTool +from enable.tools.pyface.undo_tool import UndoTool class UndoToolTestCase(unittest.TestCase, EnableTestAssistant, UnittestTools): diff --git a/enable/tools/apptools/__init__.py b/enable/tools/apptools/__init__.py index e69de29bb..de1ddeda7 100644 --- a/enable/tools/apptools/__init__.py +++ b/enable/tools/apptools/__init__.py @@ -0,0 +1,17 @@ +# +# (C) Copyright 2015 Enthought, Inc., Austin, TX +# All right reserved. +# +# This file is open source software distributed according to the terms in +# LICENSE.txt +# +import warnings + +warnings.warn( + ("apptools.undo is deprecated and will be removed in a future release. The" + " functionality is now available via pyface.undo. As a result," + " enable.tools.apptools has been deprecated in favor of" + " enable.tools.pyface."), + DeprecationWarning, + stacklevel=2 +) diff --git a/enable/tools/apptools/api.py b/enable/tools/apptools/api.py index 26c728f60..338a5aa22 100644 --- a/enable/tools/apptools/api.py +++ b/enable/tools/apptools/api.py @@ -6,23 +6,5 @@ # LICENSE.txt # -""" -Enable Apptools Integration -=========================== - -Apptools (https://github.com/enthought/apptools) is a library of useful code -for building GUI applications. It includes code for features like preferences, -undo/redo support, and seelction management. - -The code in this sub-package helps applications interface with the -functionality provided by Apptools, but is optional from the point of view -of the Enable codebase as a whole. - -""" - # Support for Undo/Redo with Enable -from .commands import ComponentCommand, MoveCommand, ResizeCommand -from .command_tool import BaseCommandTool, BaseUndoTool -from .move_command_tool import MoveCommandTool -from .resize_command_tool import ResizeCommandTool -from .undo_tool import UndoTool +from enable.tools.pyface.api import * # noqa: F401,F403 diff --git a/enable/tools/pyface/api.py b/enable/tools/pyface/api.py new file mode 100644 index 000000000..e0e140a26 --- /dev/null +++ b/enable/tools/pyface/api.py @@ -0,0 +1,14 @@ +# +# (C) Copyright 2015 Enthought, Inc., Austin, TX +# All right reserved. +# +# This file is open source software distributed according to the terms in +# LICENSE.txt +# + +# Support for Undo/Redo with Enable +from .commands import ComponentCommand, MoveCommand, ResizeCommand +from .command_tool import BaseCommandTool, BaseUndoTool +from .move_command_tool import MoveCommandTool +from .resize_command_tool import ResizeCommandTool +from .undo_tool import UndoTool diff --git a/enable/tools/apptools/command_tool.py b/enable/tools/pyface/command_tool.py similarity index 89% rename from enable/tools/apptools/command_tool.py rename to enable/tools/pyface/command_tool.py index 8fcd857c6..16a7be919 100644 --- a/enable/tools/apptools/command_tool.py +++ b/enable/tools/pyface/command_tool.py @@ -10,12 +10,12 @@ Command Tools ============= -This module provides classes for tools that work with Apptools' Undo/Redo +This module provides classes for tools that work with Pyface's Undo/Redo Command stack. """ -from apptools.undo.api import ICommandStack, IUndoManager +from pyface.undo.api import ICommandStack, IUndoManager from traits.api import Callable, Instance from enable.base_tool import BaseTool diff --git a/enable/tools/apptools/commands.py b/enable/tools/pyface/commands.py similarity index 98% rename from enable/tools/apptools/commands.py rename to enable/tools/pyface/commands.py index f1fc03991..67bec4ebd 100644 --- a/enable/tools/apptools/commands.py +++ b/enable/tools/pyface/commands.py @@ -10,13 +10,13 @@ Enable Commands =============== -This module provides :py:class:`apptools.undo.abstract_command.AbstractCommand` +This module provides :py:class:`pyface.undo.abstract_command.AbstractCommand` subclasses for common component manipulations, such as moving, resizing and setting attribute values. """ -from apptools.undo.api import AbstractCommand +from pyface.undo.api import AbstractCommand from traits.api import Bool, Instance, Tuple, Unicode from traits.util.camel_case import camel_case_to_words diff --git a/enable/tools/apptools/move_command_tool.py b/enable/tools/pyface/move_command_tool.py similarity index 97% rename from enable/tools/apptools/move_command_tool.py rename to enable/tools/pyface/move_command_tool.py index bc5ee6063..5cfc51c4a 100644 --- a/enable/tools/apptools/move_command_tool.py +++ b/enable/tools/pyface/move_command_tool.py @@ -9,7 +9,7 @@ MoveCommandTool =============== -A MoveTool that uses AppTools' undo/redo infrastructure to create undoable move +A MoveTool that uses Pyface's undo/redo infrastructure to create undoable move commands. """ diff --git a/enable/tools/apptools/resize_command_tool.py b/enable/tools/pyface/resize_command_tool.py similarity index 97% rename from enable/tools/apptools/resize_command_tool.py rename to enable/tools/pyface/resize_command_tool.py index 8702b1792..14ed95fc4 100644 --- a/enable/tools/apptools/resize_command_tool.py +++ b/enable/tools/pyface/resize_command_tool.py @@ -9,7 +9,7 @@ ResizeCommandTool ================= -A CommandTool that uses AppTools' undo/redo infrastructure to create undoable +A CommandTool that uses Pyface's undo/redo infrastructure to create undoable resize commands. """ diff --git a/enable/tools/apptools/undo_tool.py b/enable/tools/pyface/undo_tool.py similarity index 100% rename from enable/tools/apptools/undo_tool.py rename to enable/tools/pyface/undo_tool.py diff --git a/examples/enable/tools/button_tool.py b/examples/enable/tools/button_tool.py index 6fca1dbb3..9a8b5f69e 100644 --- a/examples/enable/tools/button_tool.py +++ b/examples/enable/tools/button_tool.py @@ -7,12 +7,8 @@ # """ -Undoable Move Tool -================== - -This example shows how to integrate a simple component move tool with apptools -undo/redo infrastructure. - +Button Tool +=========== """ from traits.api import Bool diff --git a/examples/enable/tools/apptools/undoable_move_tool.py b/examples/enable/tools/pyface/undoable_move_tool.py similarity index 92% rename from examples/enable/tools/apptools/undoable_move_tool.py rename to examples/enable/tools/pyface/undoable_move_tool.py index 2d1a9abb6..445e0489d 100644 --- a/examples/enable/tools/apptools/undoable_move_tool.py +++ b/examples/enable/tools/pyface/undoable_move_tool.py @@ -10,21 +10,21 @@ Undoable Move Tool ================== -This example shows how to integrate a simple component move tool with apptools +This example shows how to integrate a simple component move tool with pyface undo/redo infrastructure. """ -from apptools.undo.api import (CommandStack, ICommandStack, IUndoManager, +from pyface.undo.api import (CommandStack, ICommandStack, IUndoManager, UndoManager) -from apptools.undo.action.api import UndoAction, RedoAction +from pyface.undo.action.api import UndoAction, RedoAction from pyface.action.api import Action, Group, MenuBarManager, MenuManager from traits.api import Instance from enable.api import Container, Window, KeySpec from enable.example_application import DemoApplication, demo_main from enable.primitives.api import Box -from enable.tools.apptools.api import MoveCommandTool, UndoTool +from enable.tools.pyface.api import MoveCommandTool, UndoTool class UndoableMoveApplication(DemoApplication): @@ -35,7 +35,7 @@ class UndoableMoveApplication(DemoApplication): """ - #: The apptools undo manager the application uses. + #: The pyface undo manager the application uses. undo_manager = Instance(IUndoManager) #: The command stack that the MoveCommandTool will use.