jigsaw package¶
Submodules¶
jigsaw.Plugin module¶
-
class
jigsaw.Plugin.
JigsawPlugin
(manifest, *args)¶ Bases:
object
Base class for all jigsaw plugins
-
__init__
(manifest, *args)¶ Initializes the plugin
Parameters: - manifest – The plugin manifest
- args – Any other arguments passed to the plugin
-
disable
()¶ Handles cleaning up before disabling/unloading a plugin
-
enable
()¶ Handles the setup of a plugin on enable
-
jigsaw.PluginLoader module¶
-
class
jigsaw.PluginLoader.
PluginLoader
(plugin_paths=(), log_level=20, plugin_class=<class 'jigsaw.Plugin.JigsawPlugin'>)¶ Bases:
object
The main plugin loader class
-
__init__
(plugin_paths=(), log_level=20, plugin_class=<class 'jigsaw.Plugin.JigsawPlugin'>)¶ Initializes the plugin loader
Parameters: - plugin_paths – Paths to load plugins from
- log_level – Log level
- plugin_class – Parent class of all plugins
-
disable_all_plugins
()¶ Calls the disable method on all initialized plugins
-
enable_all_plugins
()¶ Calls the enable method on all initialized plugins
-
get_all_plugins
()¶ Gets all loaded plugins
Returns: List of all plugins
-
get_manifest
(plugin_name)¶ Gets the manifest for a specified plugin
Parameters: plugin_name – The name of the plugin Returns: The manifest for the specified plugin
-
get_module
(name)¶ Gets the module for a plugin
Parameters: name – Name of the plugin Returns: The module
-
get_plugin
(name)¶ Gets a loaded plugin
Parameters: name – Name of the plugin Returns: The plugin
-
get_plugin_loaded
(plugin_name)¶ Returns if a given plugin is loaded
Parameters: plugin_name – The plugin to check to loaded status for Returns: Whether the specified plugin is loaded
-
load_manifest
(path)¶ Loads a plugin manifest from a given path
Parameters: path – The folder to load the plugin manifest from
-
load_manifests
()¶ Loads all plugin manifests on the plugin path
-
load_plugin
(manifest, *args)¶ Loads a plugin from the given manifest
Parameters: - manifest – The manifest to use to load the plugin
- args – Arguments to pass to the plugin
-
load_plugins
(*args)¶ Loads all plugins
Parameters: args – Arguments to pass to the plugins
-
quickload
(*args)¶ Loads all manifests, loads all plugins, and then enables all plugins :param args: The args to pass to the plugin
-
reload_all_manifests
()¶ Reloads all loaded manifests, and loads any new manifests
-
reload_all_plugins
(*args)¶ Reloads all initialized plugins
-
reload_manifest
(manifest)¶ Reloads a manifest from the disk :param manifest: The manifest to reload
-
reload_plugin
(name, *args)¶ Reloads a given plugin
Parameters: - name – The name of the plugin
- args – The args to pass to the plugin
-
unload_plugin
(name)¶ Unloads a specified plugin :param name: The name of the plugin
-