Part of elisa.core.plugin_registry View In Hierarchy
Known subclasses: elisa.core.tests.test_plugin_registry.PluginRegistryMock
DOCME more.
Line # | Kind | Name | Docs |
---|---|---|---|
174 | Method | __init__ | Undocumented |
303 | Method | load_plugins | Load plugins from self.plugin_dirs. |
391 | Method | load_plugin | Load a given plugin in elisa. |
464 | Method | unload_plugin | Unload a given plugin from elisa. |
489 | Method | register_plugin_status_changed_callback | Register a callback to be fired upon (de)activation of a plugin. |
504 | Method | unregister_plugin_status_changed_callback | Unregister a callback that was previously registered to be fired upon |
530 | Method | enable_plugins | Enable all the plugins that should be enabled. |
550 | Method | enable_plugin | Enable a plugin. |
596 | Method | disable_plugin | Disable a plugin. |
639 | Method | get_plugins | Get the list of available plugins. |
651 | Method | get_enabled_plugins | Get the list of enabled plugins. |
664 | Method | get_plugin_names | Get the names of the installed plugins. |
673 | Method | get_plugin_by_name | Return the plugin matching a given name. |
686 | Method | get_plugin_metadata | Read and populate the metadata of a plugin. |
747 | Method | plugin_cache | Undocumented |
751 | Method | plugin_repository | Undocumented |
754 | Method | reload_cache | Load the cached information about downloadable plugins. |
774 | Method | update_cache | Update the cached information about downloadable plugins. |
812 | Method | get_downloadable_plugins | The list of downloadable plugins. |
829 | Method | download_plugin | Download one plugin. |
885 | Method | install_plugin | Install a plugin from a local egg file. |
932 | Method | update_plugin | Update an installed plugin for which a newer version is available in |
958 | Method | install_new_recommended_plugins | Download and install all the recommended plugins. |
1020 | Method | create_component | Create a component given its path. |
190 | Method | _create_config_section | Undocumented |
202 | Method | _deactivate_dist | Undocumented |
267 | Method | _fix_uninstalled_plugin | Undocumented |
295 | Method | _add_gstreamer_path | Undocumented |
516 | Method | _fire_registered_callbacks | Undocumented |
726 | Method | _deserialize_cache | Here the actual deserialization is done. |
1057 | 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
) |
pkg_resources.Distribution
) and the new status
(bool
, True
for enabled, False
for
disabled) as parameters, and should return a deferred. The plugin status
will be considered as changed (and the corresponding message emitted) only
when all the resulting deferreds of the registered callbacks have fired (or
errored).Parameters | callback | a callback
(type: callable
) |
Parameters | callback | a callback previously registered
(type: callable
) |
Raises | ValueError | if the callback is not registered |
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
) |
This call returns (plugin_name, status) tuples, where status is
True
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
) |
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
) |
At present only one remote, hardcoded repository is supported.
Returns | a deferred triggered when the cache is updated
(type: twisted.internet.defer.Deferred
) |
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
) |
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
) |
If needed, the egg file will be copied over to the local plugins directory and the older version of the plugin will be unloaded. The plugin will then be loaded and enabled.
Parameters | egg_file | the full path to the egg file on disk
(type: str
) |
plugin_name | the internal name of the plugin
(type: str
) | |
Returns | a deferred fired when the plugin is installed
(type: elisa.core.utils.defer.Deferred
) |
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. |
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
) |
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
) |