clan_lib: Add 'address' field to LocalHost

This commit is contained in:
Qubasa
2025-08-20 20:28:21 +02:00
parent 5120d90b85
commit 101c52f7c2
2 changed files with 11 additions and 0 deletions

View File

@@ -17,6 +17,12 @@ class Host(Protocol):
This provides a common interface for both local and remote hosts.
"""
@property
def address(self) -> str:
"""Return the address of the host."""
msg = "Subclasses must implement address property"
raise NotImplementedError(msg)
@property
def command_prefix(self) -> str | None: ...

View File

@@ -20,6 +20,11 @@ class LocalHost:
_user: str = field(default_factory=lambda: os.environ.get("USER", "root"))
_askpass_path: str | None = None
@property
def address(self) -> str:
"""Return the address of the localhost."""
return "localhost"
@property
def target(self) -> str:
"""Return a descriptive target string for localhost."""