mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-25 09:35:54 +02:00
lib.SSHClient: Move public methods down
Code beautification chore: Move the public methods of SSHClients to the bottom of the class to be consistent with other classes. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
284eb30ecf
commit
a76a6c9316
1 changed files with 18 additions and 18 deletions
|
|
@ -16,24 +16,6 @@ class SSHClient(ExecContext):
|
|||
self.__hostname = hostname
|
||||
self.__password: str|None = None
|
||||
|
||||
@property
|
||||
def hostname(self):
|
||||
return self.__hostname
|
||||
|
||||
def set_password(self, password: str) -> None:
|
||||
self.__password = password
|
||||
|
||||
@property
|
||||
def password(self) -> str:
|
||||
return self.__password
|
||||
|
||||
def set_username(self, username: str) -> None:
|
||||
self.__username = username
|
||||
|
||||
@property
|
||||
def username(self) -> str:
|
||||
return self.__username
|
||||
|
||||
@abc.abstractmethod
|
||||
async def _run_cmd(self, cmd: list[str]) -> Result:
|
||||
pass
|
||||
|
|
@ -99,6 +81,24 @@ class SSHClient(ExecContext):
|
|||
log(WARNING, f'Modifying environment over SSH is not implemented, ignored')
|
||||
return await self._run(cmd, *args, **kwargs)
|
||||
|
||||
@property
|
||||
def hostname(self):
|
||||
return self.__hostname
|
||||
|
||||
def set_password(self, password: str) -> None:
|
||||
self.__password = password
|
||||
|
||||
@property
|
||||
def password(self) -> str:
|
||||
return self.__password
|
||||
|
||||
def set_username(self, username: str) -> None:
|
||||
self.__username = username
|
||||
|
||||
@property
|
||||
def username(self) -> str:
|
||||
return self.__username
|
||||
|
||||
class SSHClientInternal(SSHClient): # export
|
||||
|
||||
def __init__(self, hostname: str) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue