| 1 |
# (C) Copyright 2007-2025 Enthought, Inc., Austin, TX |
| 2 |
# All rights reserved. |
| 3 |
# |
| 4 |
# This software is provided without warranty under the terms of the BSD |
| 5 |
# license included in LICENSE.txt and may be redistributed only under |
| 6 |
# the conditions described in the aforementioned license. The license |
| 7 |
# is also available online at http://www.enthought.com/licenses/BSD.txt |
| 8 |
# |
| 9 |
# Thanks for using Enthought open source! |
| 10 |
""" The plugin activator interface. """ |
| 11 |
|
| 12 |
|
| 13 |
# Enthought library imports. |
| 14 |
from traits.api import Interface |
| 15 |
|
| 16 |
|
| 17 |
class IPluginActivator(Interface): |
| 18 |
"""The plugin activator interface. |
| 19 |
|
| 20 |
A plugin activator is really just a collection of two strategies - one |
| 21 |
to start the plugin and one to stop it. |
| 22 |
|
| 23 |
We use an activator so that the framework can implement default start and |
| 24 |
stop strategies without forcing the plugin writer to call 'super' if they |
| 25 |
override the 'start' and 'stop' methods on 'IPlugin'. |
| 26 |
|
| 27 |
I'm not sure that having to call 'super' is such a burden, but some people |
| 28 |
seem to like it this way, and it does mean one less thing for a plugin |
| 29 |
writer to have to remember to do! |
| 30 |
|
| 31 |
""" |
| 32 |
|
| 33 |
def start_plugin(self, plugin): |
| 34 |
"""Start the specified plugin.""" |
| 35 |
|
| 36 |
def stop_plugin(self, plugin): |
| 37 |
"""Stop the specified plugin.""" |