From 82e92ac068c6765b7a48810ee5da286c1bb0f819 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Tue, 17 Feb 2026 11:52:05 +0100 Subject: [PATCH] jw.pkg.cmds.distro.backend.Backend: Add property util Add a property .util to the Backend class, instanciated on demand from to the respective distribution directory's Util class. Signed-off-by: Jan Lindemann --- src/python/jw/pkg/cmds/distro/backend/Backend.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/python/jw/pkg/cmds/distro/backend/Backend.py b/src/python/jw/pkg/cmds/distro/backend/Backend.py index 2f2ae568..8b46926d 100644 --- a/src/python/jw/pkg/cmds/distro/backend/Backend.py +++ b/src/python/jw/pkg/cmds/distro/backend/Backend.py @@ -1,7 +1,12 @@ # -*- coding: utf-8 -*- +from __future__ import annotations +from typing import TYPE_CHECKING + from ....lib.util import run_cmd, run_sudo -from ..Cmd import Cmd + +if TYPE_CHECKING: + from ..Cmd import Cmd class Backend: @@ -11,6 +16,10 @@ class Backend: async def _sudo(self, cmd: list[str], mod_env: dict[str, str] = {}, opts: list[str]=[]): return await run_sudo(cmd, mod_env=mod_env, opts=opts, interactive=self.interactive) + @property + def util(self): + return self.__parent.util + @property def parent(self): return self.__parent