Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > media > contrib-backports > by-pkgid > 5a28ce08f20e322d24ac159a4334c346 > files > 2417

python-enthought-mayavi2-2.2.0-1mdv2008.1.x86_64.rpm

""" An example plugin. """


# Enthought library imports.
from enthought.envisage.api import Plugin


class SimpleUIPlugin(Plugin):
    """ An example plugin. """

    # The shared plugin instance.
    instance = None

    ###########################################################################
    # 'object' interface.
    ###########################################################################

    def __init__(self, **kw):
        """ Creates a new plugin. """

        # Base-class constructor.
        super(SimpleUIPlugin, self).__init__(**kw)

        # Set the shared instance.
        SimpleUIPlugin.instance = self
        
        return

    ###########################################################################
    # 'Plugin' interface.
    ###########################################################################

    def start(self, application):
        """ Starts the plugin.

        Can be called manually, but is usually called exactly once when the
        plugin is first required.

        """

        pass
    
    def stop(self, application):
        """ Stops the plugin.

        Can be called manually, but is usually called exactly once when the
        application exits.

        """

        self.save_preferences()
        
        return

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