File: i_plugin_manager.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 (82 lines) | stat: -rw-r--r-- 2,044 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
""" The plugin manager interface. """


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

# Local imports.
from i_plugin import IPlugin
from plugin_event import PluginEvent


class IPluginManager(Interface):
    """ The plugin manager interface. """

    #### Events ####

    # Fired when a plugin has been added to the manager.
    plugin_added = Event(PluginEvent)
    
    # Fired when a plugin has been removed from the manager.
    plugin_removed = Event(PluginEvent)

    def __iter__(self):
        """ Return an iterator over the manager's plugins.

        """

    def add_plugin(self, plugin):
        """ Add a plugin to the manager.

        """

    def get_plugin(self, plugin_id):
        """ Return the plugin with the specified Id.

        Return None if no such plugin exists.

        """

    def remove_plugin(self, plugin):
        """ Remove a plugin from the manager.

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

        This starts all of the manager's plugins.
        
        """

    def start_plugin(self, plugin=None, plugin_id=None):
        """ Start the specified plugin.

        If a plugin is specified then start it.

        If no plugin is specified then the Id is used to look up the plugin
        and then start it. If no such plugin exists then a 'SystemError'
        exception is raised.

        """

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

        This stop's all of the plugin manager's plugins (in the reverse order
        that they were started).

        """

    def stop_plugin(self, plugin=None, plugin_id=None):
        """ Stop the specified plugin.

        If a plugin is specified then stop it (the Id is ignored).

        If no plugin is specified then the Id is used to look up the plugin and
        then stop it. If no such plugin exists then a 'SystemError' exception
        is raised.

        """
        
#### EOF ######################################################################