Uranium
Application Framework
|
Inherits QObject.
Public Member Functions | |
None | __init__ (self, "Application" application, QObject parent=None) |
None | setCheckIfTrusted (self, bool check_if_trusted, bool debug_mode=False) |
bool | getCheckIfTrusted (self) |
None | initializeBeforePluginsAreLoaded (self) |
None | initializeAfterPluginsAreLoaded (self) |
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) |
def | getAllMetaData (self, **Any kwargs) |
List[str] | getDisabledPlugins (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 | isBundledPlugin (self, str plugin_id) |
None | loadPlugins (self, Optional[Dict[str, Any]] metadata=None) |
bool | isPluginApiVersionCompatible (self, "Version" plugin_api_version) |
None | loadPlugin (self, str plugin_id) |
None | removeCorruptedPluginMessage (self, str plugin_id) |
Dict[str, str] | uninstallPlugin (self, str plugin_id) |
PluginObject | getPluginObject (self, str plugin_id) |
None | addSupportedPluginExtension (self, str extension, str description) |
List[str] | supportedPluginExtensions (self) |
Optional[str] | getPluginPath (self, str plugin_id) |
None | addType (cls, str plugin_type, Callable[[Any], None] register_function) |
None | removeType (cls, str plugin_type) |
"PluginRegistry" | getInstance (cls, *args, **kwargs) |
Public Attributes | |
preloaded_plugins | |
Protected Member Functions | |
None | _savePluginData (self) |
def | _acceptedRemoveCorruptedPluginMessage (self, str plugin_id, Message original_message) |
None | _installPlugin (self, str plugin_id, str plugin_path) |
None | _removePlugin (self, str plugin_id) |
Optional[str] | _getPluginIdFromFile (self, str filename) |
List[str] | _findInstalledPlugins (self, paths=None) |
Optional[types.ModuleType] | _findPlugin (self, str plugin_id) |
Optional[str] | _locatePlugin (self, str plugin_id, str folder) |
bool | _handleCentralStorage (self, str file_data, str plugin_path, bool is_bundled_plugin=False) |
def | _parsePluginInfo (self, plugin_id, file_data, meta_data) |
bool | _populateMetaData (self, str plugin_id) |
bool | _subsetInDict (self, Dict[Any, Any] dictionary, Dict[Any, Any] subset) |
None | _addPluginObject (self, PluginObject plugin_object, str plugin_id, str plugin_type) |
Static Protected Attributes | |
dict | _type_register_map = {} |
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. [plugins]: docs/plugins.md
|
protected |
Try to find a module implementing a plugin :param plugin_id: The name of the plugin to find :returns: module if it was found (and, if 'self._check_if_trusted' is set, also secure), None otherwise
|
protected |
Plugins can indicate that they want certain things to be stored in a central location. In the case of a signed plugin you *must* do this by means of the central_storage.json file. :param file_data: The data as loaded from the file :param plugin_path: The location of the plugin on the file system :return: False if there is a security suspicion, True otherwise (even if the method otherwise fails).
|
protected |
Populate the list of metadata
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. :param plugin_type: The name of the plugin type to add. :param register_function: A callable that takes an object as parameter.
PluginObject UM.PluginRegistry.PluginRegistry.getPluginObject | ( | self, | |
str | plugin_id | ||
) |
Get a specific plugin object given an ID. If not loaded, load it. :param plugin_id: The ID of the plugin object to get.
Optional[str] UM.PluginRegistry.PluginRegistry.getPluginPath | ( | self, | |
str | plugin_id | ||
) |
Get the path to a plugin. :param plugin_id: The PluginObject.getPluginId() of the plugin. :return: The absolute path to the plugin or an empty string if the plugin could not be found.
None UM.PluginRegistry.PluginRegistry.loadPlugins | ( | self, | |
Optional[Dict[str, Any]] | metadata = None |
||
) |
Load all plugins matching a certain set of metadata :param metadata: The meta data that needs to be matched. NOTE: This is the method which kicks everything off at app launch.
None UM.PluginRegistry.PluginRegistry.removeCorruptedPluginMessage | ( | self, | |
str | plugin_id | ||
) |
Shows a message to the user remove the corrupted plugin
None UM.PluginRegistry.PluginRegistry.removeType | ( | cls, | |
str | plugin_type | ||
) |
Remove a plugin type. :param plugin_type: The plugin type to remove.