From 0d0dfc8ebec5ed957686a7c42095bcbcc8b2059d Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Mon, 24 May 2021 14:40:21 +0200 Subject: Added/moved comments. --- archinstall/lib/plugins.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/archinstall/lib/plugins.py b/archinstall/lib/plugins.py index bf4b7720..a61be30b 100644 --- a/archinstall/lib/plugins.py +++ b/archinstall/lib/plugins.py @@ -80,15 +80,17 @@ def load_plugin(path :str): # -> module (not sure how to write that in type defi elif parsed_url.scheme in ('https', 'http'): namespace = import_via_path(localize_path(path)) - # Version dependency via __archinstall__version__ variable (if present) in the plugin - # Any errors in version inconsistency will be handled through normal error handling if not defined. if namespace in sys.modules: + # Version dependency via __archinstall__version__ variable (if present) in the plugin + # Any errors in version inconsistency will be handled through normal error handling if not defined. if hasattr(sys.modules[namespace], '__archinstall__version__'): archinstall_major_and_minor_version = float(storage['__version__'][:find_nth(storage['__version__'], '.', 2)]) if sys.modules[namespace].__archinstall__version__ < archinstall_major_and_minor_version: log(f"Plugin {sys.modules[namespace]} does not support the current Archinstall version.", fg="red", level=logging.ERROR) + # Locate the plugin entry-point called Plugin() + # This in accordance with the entry_points() from setup.cfg above if hasattr(sys.modules[namespace], 'Plugin'): try: plugins[namespace] = sys.modules[namespace].Plugin() -- cgit v1.2.3-54-g00ecf