seq  1.1.0
 All Classes Namespaces Files Functions Variables Groups Pages
Classes | Functions | Variables
etr.plugin Namespace Reference

Classes

class  Plugin
 Plugin base class to simplify implementation. More...
 
class  PluginMgr
 Plugin instance manager. More...
 
class  PluginRegister
 Plugin register containing types but not instances of plugins. More...
 

Functions

def plugin
 Class decorator that registers the class as a plugin. More...
 

Variables

list ContextUnion = Union[ConfigurationContext, SetupContext, RunContext, TeardownContext]
 

Function Documentation

def etr.plugin.plugin (   name)

Class decorator that registers the class as a plugin.

Although not it's not necessary that plugins inherit from Plugin, they need to implement the same methods.

@plugin('myplugin')
class MyPlugin(Plugin):

    @classmethod
    def add_options(cls, parser):
        '''Optional

        Used to add custom command line options.

        @note: Must be a static method.
        '''
        pass

    def setup(self, ctx:SetupContext):
        '''Optional

        Called during setup step
        '''
        pass

    def run(self, ctx:RunContext):
        '''Optional

        Called during run
        '''
        pass

    def teardown(self, ctx:TeardownContext):
        '''Optional

        Called during teardown
        '''
        pass

Variable Documentation

list etr.plugin.ContextUnion = Union[ConfigurationContext, SetupContext, RunContext, TeardownContext]