mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-25 17:45:55 +02:00
lib.ExecContext.username: Add property
Add the property .username, backed by the protected _username() callback. It should return the user run()'s cmd parameter is executed as. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
5ea6ab0383
commit
9f756222fe
3 changed files with 15 additions and 4 deletions
|
|
@ -240,9 +240,13 @@ class ExecContext(Base):
|
|||
super().__init__(uri=uri, interactive=interactive, verbose_default=verbose_default)
|
||||
|
||||
@abc.abstractmethod
|
||||
async def _run(self, *args, **kwargs) -> Result:
|
||||
def _username(self) -> str:
|
||||
pass
|
||||
|
||||
@property
|
||||
def username(self) -> str:
|
||||
return self._username()
|
||||
|
||||
async def run(
|
||||
self,
|
||||
cmd: list[str],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue