Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-04-30 15:33:26 +0200
committerAnton Hvornum <anton@hvornum.se>2021-04-30 15:33:26 +0200
commit25b699b44ea272e9bac7d75c7d86871e082122ae (patch)
tree4308ae333b8a34031254f1bebc5ad5a925837407 /archinstall
parentb59a40606974a82e1d99751fd68818c3b7b0fe0f (diff)
Automatic loading of plugins
Diffstat (limited to 'archinstall')
-rw-r--r--archinstall/lib/plugins.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/archinstall/lib/plugins.py b/archinstall/lib/plugins.py
index adf900b9..f744661a 100644
--- a/archinstall/lib/plugins.py
+++ b/archinstall/lib/plugins.py
@@ -1 +1,13 @@
-plugins = {} \ No newline at end of file
+import pkgutil
+import importlib
+import imp # Deprecated
+
+plugins = {}
+
+for module_info in pkgutil.iter_modules(path=None, prefix=''):
+ if 'archinstall-' in module_info.name and module_info.ispkg:
+ try:
+ modulesource = importlib.import_module(module_info.name)
+ imp.reload(modulesource)
+ except Exception as e:
+ print('Could not load plugin {} {}'.format(modname, e)) \ No newline at end of file