diff --git a/src/python/jw/pkg/lib/Distro.py b/src/python/jw/pkg/lib/Distro.py index 9ca38549..34920f28 100644 --- a/src/python/jw/pkg/lib/Distro.py +++ b/src/python/jw/pkg/lib/Distro.py @@ -18,6 +18,10 @@ class Distro(abc.ABC): def __init__(self, ec: ExecContext): assert ec is not None self.__exec_context = ec + self.__id: str|None = None + + def __set_id(self, id: str) -> None: + self.__id = id # == Load @@ -38,10 +42,16 @@ class Distro(abc.ABC): log(ERR, f'Failed to import Distro module {module_path} ({str(e)})') raise cls = getattr(module, 'Distro') - return cls(*args, **kwargs) + ret = cls(*args, **kwargs) + ret.__set_id(backend_id) + return ret # == Convenience methods + @property + def id(self) -> str: + return self.__id + @property def ctx(self) -> ExecContext: return self.__exec_context