Base class for all loadable modules.
More...
|
| def | __init__ (self, manager, name, config=None, callbacks=None, kwargs) |
| | Initialise Base class object and set up its state machine. More...
|
| |
|
def | log (self) |
| | Returns a logger object.
|
| |
|
def | is_module_threaded (self) |
| | Returns whether the module shall be started in a thread.
|
| |
| def | on_activate (self) |
| | Method called when module is activated. More...
|
| |
| def | on_deactivate (self) |
| | Method called when module is deactivated. More...
|
| |
| def | getStatusVariables (self) |
| | Return a dict of variable names and their content representing the module state for saving. More...
|
| |
| def | setStatusVariables (self, variableDict) |
| | Give a module a dict of variable names and their content representing the module state. More...
|
| |
| def | getConfiguration (self) |
| | Return the configration dictionary for this module. More...
|
| |
| def | get_connector (self, connector_name) |
| | Return module connected to the given named connector. More...
|
| |
| def | __new__ (cls, name, bases, attrs) |
| | Collect declared Connectors, ConfigOptions and StatusVars into dictionaries. More...
|
| |
Base class for all loadable modules.
- Ensure that the program will not die during the load of modules in any case, and therefore do nothing!!!
- Initialize modules
- Provides a self identification of the used module
- Output redirection (instead of print)
- Provides a self de-initialization of the used module
- Reload the module with code changes
- Get your own configuration (for save)
- Get name of status variables
- Get status variables
- Reload module data (from saved variables)
◆ __init__()
| def core.module.BaseMixin.__init__ |
( |
|
self, |
|
|
|
manager, |
|
|
|
name, |
|
|
|
config = None, |
|
|
|
callbacks = None, |
|
|
|
kwargs |
|
) |
| |
Initialise Base class object and set up its state machine.
- Parameters
-
| object | self: the object being initialised |
| object | manager: the manager object that |
| str | name: unique name for this object |
| dict | configuration: parameters from the configuration file |
| dict | callbacks: dictionary specifying functions to be run on state machine transitions |
◆ get_connector()
| def core.module.BaseMixin.get_connector |
( |
|
self, |
|
|
|
connector_name |
|
) |
| |
Return module connected to the given named connector.
- Parameters
-
| str | connector_name: name of the connector |
- Returns
- obj: module that is connected to the named connector
- Deprecated:
- instead of get_connector(connector_name) just use connector_name(). Enabled by using Connector objects as class variables
◆ getConfiguration()
| def core.module.BaseMixin.getConfiguration |
( |
|
self | ) |
|
Return the configration dictionary for this module.
- Returns
- dict: confiuration dictionary
- Deprecated:
- declare and use ConfigOption class variables directly
◆ getStatusVariables()
| def core.module.BaseMixin.getStatusVariables |
( |
|
self | ) |
|
Return a dict of variable names and their content representing the module state for saving.
- Returns
- dict: variable names and contents.
- Deprecated:
- declare and use StatusVar class variables directly
◆ on_activate()
| def core.module.BaseMixin.on_activate |
( |
|
self | ) |
|
Method called when module is activated.
If not overridden this method returns an error.
◆ on_deactivate()
| def core.module.BaseMixin.on_deactivate |
( |
|
self | ) |
|
Method called when module is deactivated.
If not overridden this method returns an error.
◆ setStatusVariables()
| def core.module.BaseMixin.setStatusVariables |
( |
|
self, |
|
|
|
variableDict |
|
) |
| |
Give a module a dict of variable names and their content representing the module state.
- Parameters
-
| OrderedDict | dict: variable names and contents. |
- Deprecated:
- declare and use StatusVar class variables
The documentation for this class was generated from the following file: