PTU5KAS/kas
Paul Barker 5e3ca820b3 plugins: Refactor plugin identification and access
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>
2020-10-21 17:17:03 +02:00
..
plugins plugins: Refactor plugin identification and access 2020-10-21 17:17:03 +02:00
__init__.py __init__: Better support introspection 2018-12-07 09:56:09 +01:00
__main__.py Correct grammar, spelling and copyright year in files 2018-09-05 12:46:35 +02:00
__version__.py Release 2.2 2020-08-20 09:17:34 +02:00
config.py config: Make common repository check a bit more Pythonic 2020-07-31 11:32:25 +02:00
configschema.py config: Allow a default repo to be specified for patches 2020-07-07 11:48:47 +02:00
context.py kas: Support --update argument 2020-06-17 07:58:40 +02:00
includehandler.py kas: support .yaml extension 2020-07-24 18:44:45 +02:00
kas.py plugins: Refactor plugin identification and access 2020-10-21 17:17:03 +02:00
libcmds.py Report invalid repo key 2020-10-10 16:17:16 +02:00
libkas.py plugins: Move plugins to dedicated submodule 2020-10-21 17:13:06 +02:00
repos.py repos: Make set_remote_url_cmd fail loudly 2020-10-13 14:06:31 +02:00