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:
Jan Lindemann 2026-03-18 05:58:12 +01:00
commit a76a6c9316

View file

@ -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: