File: i_plugin.py

package info (click to toggle)
python-envisagecore 3.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,096 kB
  • ctags: 1,063
  • sloc: python: 4,115; makefile: 7; sh: 5
file content (55 lines) | stat: -rw-r--r-- 1,585 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
""" The plugin interface. """


# Enthought library imports.
from enthought.traits.api import Instance, Interface, Str

# Local imports.
from i_plugin_activator import IPluginActivator


class IPlugin(Interface):
    """ The plugin interface. """

    # The activator used to start and stop the plugin.
    activator = Instance(IPluginActivator)
    
    # The application that the plugin is part of.
    application = Instance('enthought.envisage.api.IApplication')

    # The name of a directory (created for you) that the plugin can read and
    # write to at will.
    home = Str

    # The plugin's unique identifier.
    #
    # Where 'unique' technically means 'unique within the plugin manager', but
    # since the chances are that you will want to include plugins from external
    # sources, this really means 'globally unique'! Using the Python package
    # path might be useful here. e.g. 'enthought.envisage'.
    id = Str

    # The plugin's name (suitable for displaying to the user).
    name = Str

    def start(self):
        """ Start the plugin.

        This method is called by the framework when the application is starting
        up. If you want to start a plugin manually use::

          application.start_plugin(plugin)

        """

    def stop(self):
        """ Stop the plugin.

        This method is called by the framework when the application is
        stopping. If you want to stop a plugin manually use::

          application.stop_plugin(plugin)

        """

#### EOF ######################################################################