5e3ca820b3
This change moves all plugin handling code into the kas.plugins module. New accessor functions `plugins.get(name)` and `plugins.all()` are provided to wrap the plugins dictionary so that the kas main function doesn't need to worry about how this is accessed. Plugins are loaded at runtime rather than at parse time by calling `plugins.load()` which gives us an improved ability to handle errors. The `@kasplugin` decorator is removed as it modified and attribute on the kasplugin function itself when a plugin module was loaded. Importing a module should not result in changes to a variable in a different module as it leads to an initialization code flow which is difficult to reason about. Instead, plugin modules should now list the plugins which they introduce in a `__KAS_PLUGINS__` list which will be walked at runtime by `plugins.load()`. Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> |
||
---|---|---|
.. | ||
__init__.py | ||
build.py | ||
shell.py |