1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
""" The traits UI handler for the text editor. """
# Enthought library imports.
from enthought.traits.ui.api import Handler
class TextEditorHandler(Handler):
""" The traits UI handler for the text editor. """
###########################################################################
# 'TextEditorHandler' interface.
###########################################################################
# fixme: We need to work out how to create these 'dispatch' methods
# dynamically! Plugins will want to add bindings to the editor to bind
# a key to an action.
def run(self, info):
""" Run the text as Python code. """
info.object.run()
return
def save(self, info):
""" Save the text to disk. """
info.object.save()
return
#### EOF ######################################################################
|