Part of elisa.core.plugin_registry View In Hierarchy
Known subclasses: elisa.core.tests.test_plugin_registry.PluginRegistryMock
The plugin registry handles plugins in Elisa as long as it is running.
DOCME more.Line # | Kind | Name | Docs |
---|---|---|---|
112 | Method | __init__ | Undocumented |
240 | Method | load_plugins | Load plugins from self.plugin_dirs. |
317 | Method | load_plugin | Load a given plugin in elisa. |
352 | Method | unload_plugin | Unload a given plugin from elisa. |
377 | Method | enable_plugins | Enable all the plugins that should be enabled. |
397 | Method | enable_plugin | Enable a plugin. |
442 | Method | disable_plugin | Disable a plugin. |
482 | Method | get_plugins | Get the list of available plugins. |
494 | Method | get_enabled_plugins | Get the list of enabled plugins. |
507 | Method | get_plugin_names | Get the names of the installed plugins. |
516 | Method | get_plugin_by_name | Return the plugin matching a given name. |
529 | Method | get_plugin_metadata | Read and populate the metadata of a plugin. |
577 | Method | plugin_cache | Undocumented |
581 | Method | plugin_repository | Undocumented |
584 | Method | reload_cache | Load the cached information about downloadable plugins. |
604 | Method | update_cache | Update the cached information about downloadable plugins. |
641 | Method | get_downloadable_plugins | The list of downloadable plugins. |
658 | Method | download_plugin | Download one plugin. |
698 | Method | update_plugin | Update an installed plugin for which a newer version is available in |
737 | Method | install_recommended_plugins | Download and install all the recommended plugins. |
789 | Method | create_component | Create a component given its path. |
126 | Method | _create_config_section | Undocumented |
138 | Method | _deactivate_dist | Undocumented |
207 | Method | _fix_uninstalled_plugin | Undocumented |
235 | Method | _add_gstreamer_path | Undocumented |
556 | Method | _deserialize_cache | Here the actual deserialization is done. |
826 | Method | _call_hook | Undocumented |
Parameters | disabled_plugins | a list of plugins that should be disabled
(type: list of str
) |
Notes | This function runs without returning to the reactor for as long as it takes. There is no point in making it return before it is done as the plugin environment needs to be set up before any other part of elisa can run correctly. | |
By default, all the available plugins are enabled. | ||
Unknown Field: attention | This function should be called as early as possible at startup, before using any plugin. |
Parameters | plugin | the plugin to load
(type: pkg_resources.Distribution
) |
Parameters | plugin | the plugin to unload
(type: pkg_resources.Distribution
) |
Returns | a deferred fired when the plugin is fully unloaded
(type: twisted.internet.defer.Deferred
) |
Returns | a deferred fired when all plugins have been enabled
(type: twisted.internet.defer.Deferred
) | |
Unknown Field: attention | this method can be called only once and should be called upon startup of
the application, after load_plugins .
|
Parameters | plugin_name | the name of the plugin to enable
(type: str
) |
Returns | a deferred fired when the plugin is enabled
(type: twisted.internet.defer.Deferred
) |
Parameters | plugin_name | the name of the plugin to disable
(type: str
) |
Returns | a deferred fired when the plugin is disabled
(type: twisted.internet.defer.Deferred
) |
Get the list of available plugins.
This call returns (plugin_name, status) tuples, where status isTrue
if the plugin is enabled, False
otherwise.
Returns | a generator yielding (plugin_name, status) tuples
(type: generator
) |
Returns | generator yielding plugin names
(type: generator
) |
Returns | a generator yielding plugin names
(type: generator
) |
Parameters | plugin_name | the name of the plugin
(type: str
) |
Returns | the plugin, or None if no plugin matches the given name
(type: pkg_resources.Distribution
) |
Parameters | plugin | a plugin
(type: pkg_resources.Distribution
) |
Here the actual deserialization is done.
The present file format is json, but that can be changed without affecting the rest of the system.Parameters | cache | the serialized data
(type: str
) |
Returns | the list of plugins
(type: list of dict
) |
Returns | whether the loading went well.
(type: bool
) |
Update the cached information about downloadable plugins.
At present only one remote, hardcoded repository is supported.Returns | a deferred triggered when the cache is updated
(type: twisted.internet.defer.Deferred
) |
The list of downloadable plugins.
Each plugin is represented as a Python dictionary.Parameters | reload_cache | whether to reload the local cache from disk
(type: bool
) |
Returns | a list of one dict per plugin.
(type: list
) |
Download one plugin.
A plugin is represented with a dictionary. Some expected keys are listed at https://elisa.fluendo.com/wiki/Specs/PluginsMetadata. Here we just rely on 'egg_name' and 'uri'. If they change, this code will simply break.Parameters | plugin | the plugin dictionary
(type: dict
) |
Returns | a deferred triggered when done, reporting the path to the downloaded egg
file
(type: twisted.internet.defer.Deferred
) |
Update an installed plugin for which a newer version is available in the plugin repository.
Updating a plugin will disable the current version if needed, unload it, download the new version, load it and enable it.Parameters | plugin_dict | a dictionary representing the plugin as returned by get_downloadable_plugins
(type: dict
) |
Returns | a deferred fired when the update is complete
(type: elisa.core.utils.defer.Deferred
) | |
Unknown Field: attention | this code assumes that the plugin to update is currently installed and that the plugin repository actually provides a newer version. Behaviour outside of these constraints is undefined. |
Download and install all the recommended plugins.
This will typically happen when first running Elisa after installation, if the user selected the 'Install Recommended Plugins' option in the installer.Returns | a deferred fired when the installation is complete
(type: elisa.core.utils.defer.Deferred
) |
Create a component given its path.
The path is in module:Component syntax, eg elisa.plugins.my_plugin:MyComponent.Parameters | path | the component path
(type: str
) |
config | the configuration to set for the component
(type: elisa.core.config.Config
) | |
Returns | an instance of the component identified by path
(type: elisa.core.component.Component
or a subclass
) |