mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-24 17:23:36 +02:00
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 <jan@janware.com>
This commit is contained in:
parent
78835ecc9c
commit
82e92ac068
1 changed files with 10 additions and 1 deletions
|
|
@ -1,7 +1,12 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ....lib.util import run_cmd, run_sudo
|
from ....lib.util import run_cmd, run_sudo
|
||||||
from ..Cmd import Cmd
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from ..Cmd import Cmd
|
||||||
|
|
||||||
class Backend:
|
class Backend:
|
||||||
|
|
||||||
|
|
@ -11,6 +16,10 @@ class Backend:
|
||||||
async def _sudo(self, cmd: list[str], mod_env: dict[str, str] = {}, opts: list[str]=[]):
|
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)
|
return await run_sudo(cmd, mod_env=mod_env, opts=opts, interactive=self.interactive)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def util(self):
|
||||||
|
return self.__parent.util
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def parent(self):
|
def parent(self):
|
||||||
return self.__parent
|
return self.__parent
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue