mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-25 17:45:55 +02:00
lib.ExecContext.__init__(): Add parameter uri
Take a positional uri argument to the constructor of ExecContext, forcing SSHClient to follow suit. The latter was instantiated with a hostname as only argument up to now, which still works as a special case of an uri. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
db9bf1826d
commit
888c1e7f16
3 changed files with 20 additions and 10 deletions
|
|
@ -11,7 +11,8 @@ class Result(NamedTuple):
|
|||
|
||||
class ExecContext(abc.ABC):
|
||||
|
||||
def __init__(self, interactive: bool=True, verbose_default=False):
|
||||
def __init__(self, uri: str, interactive: bool=True, verbose_default=False):
|
||||
self.__uri = uri
|
||||
self.__interactive = interactive
|
||||
self.__verbose_default = verbose_default
|
||||
assert verbose_default is not None
|
||||
|
|
@ -21,6 +22,10 @@ class ExecContext(abc.ABC):
|
|||
return verbose
|
||||
return self.__verbose_default
|
||||
|
||||
@property
|
||||
def uri(self) -> str:
|
||||
return self.__uri
|
||||
|
||||
@property
|
||||
def interactive(self) -> bool:
|
||||
return self.__interactive
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue