mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-08-30 05:19:56 +00:00
PEP-673 use Self as return type for classmethods (#94)
* PEP-673 use Self as return type for classmethods * add dummy test file * remove python3.10 compat
This commit is contained in:
@ -32,8 +32,8 @@ class Client:
|
||||
base build status reporter client
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def load(cls: type[Client], configuration: Configuration, *, report: bool) -> Client:
|
||||
@staticmethod
|
||||
def load(configuration: Configuration, *, report: bool) -> Client:
|
||||
"""
|
||||
load client from settings
|
||||
|
||||
@ -45,7 +45,7 @@ class Client:
|
||||
Client: client according to current settings
|
||||
"""
|
||||
if not report:
|
||||
return cls()
|
||||
return Client()
|
||||
|
||||
address = configuration.get("web", "address", fallback=None)
|
||||
host = configuration.get("web", "host", fallback=None)
|
||||
@ -58,7 +58,7 @@ class Client:
|
||||
if address or (host and port) or socket:
|
||||
from ahriman.core.status.web_client import WebClient
|
||||
return WebClient(configuration)
|
||||
return cls()
|
||||
return Client()
|
||||
|
||||
def add(self, package: Package, status: BuildStatusEnum) -> None:
|
||||
"""
|
||||
|
Reference in New Issue
Block a user