emsm.core.plugins
¶
-
exception
emsm.core.plugins.
PluginException
[source]¶ Bases:
Exception
Base class for all exceptions in this module.
-
exception
emsm.core.plugins.
PluginImplementationError
(plugin, msg)[source]¶ Bases:
emsm.core.plugins.PluginException
Raised if a plugin is not correct implemented.
-
exception
emsm.core.plugins.
PluginOutdatedError
(plugin)[source]¶ Bases:
emsm.core.plugins.PluginException
Raised if the version of the plugin is not compatible with the EMSM version.
See also
-
class
emsm.core.plugins.
PluginManager
(app)[source]¶ Bases:
object
Loads and manages all plugins.
If you want to write a plugin and search for the docs, take a look at the
hellodolly
plugin.See also
-
get_module
(plugin_name)[source]¶ Returns the Python module object that contains the plugin with the name plugin_name or
None
if there is no plugin with that name.
-
get_plugin
(plugin_name)[source]¶ Returns the instance of the plugin with the name plugin_name that is currently loaded and used by the EMSM.
-
get_plugin_type
(plugin_name)[source]¶ Returns the plugin class for the plugin with the name plugin_name or
None
, if there is no plugin with that name.
-
import_from_directory
(directory)[source]¶ Imports all Python modules in the
directory
.Files that do not contain a valid EMSM plugin, are ignored. You can check the log files to see which plugins have been ignored.
See also
-
import_plugin
(path)[source]¶ Loads the plugin located at path.
Note
The path is no longer added to
sys.path
(EMSM Vers. >= 3).Raises: - PluginOutdatedError – when the plugin is outdated.
- PluginImplementationError – when the plugin is not correct implemented.
See also
_plugin_is_outdated()
-
init_plugins
()[source]¶ Creates a plugin instance for each loaded plugin class.
When you call this method multiple times, only plugins that have not been initialised already, will be initialised.
-
plugin_is_available
(plugin_name)[source]¶ Returns
True
, if the plugin with the name plugin_name is available.
-