index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
-rw-r--r-- | archinstall/lib/plugins.py | 25 |
diff --git a/archinstall/lib/plugins.py b/archinstall/lib/plugins.py index f744661a..f7f8bc4e 100644 --- a/archinstall/lib/plugins.py +++ b/archinstall/lib/plugins.py @@ -1,13 +1,24 @@ import pkgutil import importlib import imp # Deprecated +from .storage import storage plugins = {} +PLUGIN_PREFIXES = 'archinstall-' -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 +if (plugin_list := storage.get('plugins', None)): + if type(plugin_list) == str and plugin_list != '*': + plugin_list = plugin_list.split(',') + + for module_info in pkgutil.iter_modules(path=None, prefix=''): + if not module_info.ispkg: + continue + + # If --plugins=* and <iterator:plugin> == 'archinstall-' + # of --plugins=name is <iterator:plugin> + if (plugin_list == '*' and PLUGIN_PREFIXES in module_info.name) or (module_info.name in plugin_list): + 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 |