summaryrefslogtreecommitdiff
path: root/src/buildstream/_frontend
diff options
context:
space:
mode:
authorTristan van Berkom <tristan.vanberkom@codethink.co.uk>2020-05-20 19:17:10 +0900
committerTristan van Berkom <tristan.vanberkom@codethink.co.uk>2020-05-28 15:02:23 +0900
commit3f418029af80591d7a4592ee7e5a9312dfdf2d54 (patch)
tree4e4716ac33b864d7c65de8db23242335a296c54d /src/buildstream/_frontend
parent1a85a6d5524a4eddaa6c0382fb936732c29fffb3 (diff)
downloadbuildstream-3f418029af80591d7a4592ee7e5a9312dfdf2d54.tar.gz
_pluginfactory: Delegating the work of locating plugins to the PluginOrigin
This way we split up the logic of how to load plugins from different origins into their respective classes. This commit also: o Introduces PluginType (which is currently either SOURCE or ELEMENT) o Reduces the complexity of the PluginFactory constructor o Kills the loaded_dependencies list and the all_loaded_plugins API, and replaces both of these with a new list_plugins() API. Consequently the jobpickler.py from the scheduler, and the widget.py from the frontend, are updated to use list_plugins(). o Split up the PluginOrigin implementations into separate files Instead of having all PluginOrigin classes in pluginorigin.py, split it up into one base class and separate files for each implementation, which is more inline with BuildStream coding style. This has the unfortunate side effect of adding load_plugin_origin() into the __init__.py file, because keeping new_from_node() as a PluginOrigin class method cannot be done without introducing a cyclic dependency with PluginOrigin and it's implementations.
Diffstat (limited to 'src/buildstream/_frontend')
-rw-r--r--src/buildstream/_frontend/widget.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/buildstream/_frontend/widget.py b/src/buildstream/_frontend/widget.py
index fcc951d00..81ca2f7b5 100644
--- a/src/buildstream/_frontend/widget.py
+++ b/src/buildstream/_frontend/widget.py
@@ -481,12 +481,13 @@ class LogLine(Widget):
# Plugins
text += self._format_plugins(
- project.first_pass_config.element_factory.loaded_dependencies,
- project.first_pass_config.source_factory.loaded_dependencies,
+ [p for p, _, _ in project.first_pass_config.element_factory.list_plugins()],
+ [p for p, _, _ in project.first_pass_config.source_factory.list_plugins()],
)
if project.config.element_factory and project.config.source_factory:
text += self._format_plugins(
- project.config.element_factory.loaded_dependencies, project.config.source_factory.loaded_dependencies
+ [p for p, _, _ in project.config.element_factory.list_plugins()],
+ [p for p, _, _ in project.config.source_factory.list_plugins()],
)
# Pipeline state