File: text_editor_handler.py

package info (click to toggle)
python-envisageplugins 3.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,600 kB
  • sloc: python: 6,968; sh: 11; makefile: 8; lisp: 1
file content (32 lines) | stat: -rw-r--r-- 897 bytes parent folder | download | duplicates (2)
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 ######################################################################