Uranium
Application Framework
|
A central object to dynamically load modules as plugins. More...
Inherits QObject.
Public Member Functions | |
None | __init__ (self, "Application" application, QObject parent=None) |
None | initializeBeforePluginsAreLoaded (self) |
None | initializeAfterPluginsAreLoaded (self) |
None | addExternalPlugins (self, List[Dict[str, Any]] plugin_list) |
None | addPluginLocation (self, str location) |
bool | checkRequiredPlugins (self, List[str] required_plugins) |
None | disablePlugin (self, str plugin_id) |
None | enablePlugin (self, str plugin_id) |
List[str] | getActivePlugins (self) |
List[str] | getAvailablePlugins (self) |
def | getAllMetaData (self, **Any kwargs) |
List[str] | getDisabledPlugins (self) |
List[str] | getExternalPlugins (self) |
List[str] | getInstalledPlugins (self) |
Dict[str, Any] | getMetaData (self, str plugin_id) |
Optional[Dict[str, str]] | installPlugin (self, str plugin_path) |
bool | isActivePlugin (self, str plugin_id) |
bool | isAvailablePlugin (self, str plugin_id) |
bool | isInstalledPlugin (self, str plugin_id) |
bool | isBundledPlugin (self, str plugin_id) |
None | loadPlugins (self, Optional[dict] metadata=None) |
Load all plugins matching a certain set of metadata. More... | |
None | loadPlugin (self, str plugin_id) |
Dict[str, str] | uninstallPlugin (self, str plugin_id) |
PluginObject | getPluginObject (self, str plugin_id) |
Get a speficic plugin object given an ID. More... | |
None | addSupportedPluginExtension (self, str extension, str description) |
List[str] | supportedPluginExtensions (self) |
Optional[str] | getPluginPath (self, str plugin_id) |
Get the path to a plugin. More... | |
None | addType (cls, str plugin_type, Callable[[Any], None] register_function) |
Add a new plugin type. More... | |
None | removeType (cls, str plugin_type) |
Remove a plugin type. More... | |
"PluginRegistry" | getInstance (cls, *args, **kwargs) |
Static Public Attributes | |
int | APIVersion = 5 |
str | |
result | |
supportedPluginExtensionsChanged = pyqtSignal() | |
notify | |
A central object to dynamically load modules as plugins.
The PluginRegistry class can load modules dynamically and use them as plugins. Each plugin module is expected to be a directory with and __init__
file defining a getMetaData
and a register
function.
For more details, see the plugins file.
None UM.PluginRegistry.PluginRegistry.addType | ( | cls, | |
str | plugin_type, | ||
Callable[[Any], None] | register_function | ||
) |
Add a new plugin type.
This function is used to add new plugin types. Plugin types are simple string identifiers that match a certain plugin to a registration function.
The callable register_function
is responsible for handling the object. Usually it will add the object to a list of objects in the relevant class. For example, the plugin type 'tool' has Controller::addTool as register function.
register_function
will be called every time a plugin of type
is loaded.
type | string The name of the plugin type to add. |
register_function | callable A callable that takes an object as parameter. |
PluginObject UM.PluginRegistry.PluginRegistry.getPluginObject | ( | self, | |
str | plugin_id | ||
) |
Get a speficic plugin object given an ID.
If not loaded, load it.
plugin_id | string The ID of the plugin object to get. |
Optional[str] UM.PluginRegistry.PluginRegistry.getPluginPath | ( | self, | |
str | plugin_id | ||
) |
Get the path to a plugin.
plugin_id | string The ID of the plugin. |
None UM.PluginRegistry.PluginRegistry.loadPlugins | ( | self, | |
Optional[dict] | metadata = None |
||
) |
Load all plugins matching a certain set of metadata.
meta_data | dict The meta data that needs to be matched. |
None UM.PluginRegistry.PluginRegistry.removeType | ( | cls, | |
str | plugin_type | ||
) |
Remove a plugin type.
type | The plugin type to remove. |