clan_lib: Add 'address' field to LocalHost
This commit is contained in:
@@ -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: ...
|
||||
|
||||
|
||||
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user