make configuration object arch-specific

This commit is contained in:
2021-03-31 00:04:13 +03:00
parent fbf6748d4a
commit 6e9dcca254
21 changed files with 98 additions and 98 deletions

View File

@ -111,15 +111,14 @@ class Client:
return self.add(package, BuildStatusEnum.Unknown)
@staticmethod
def load(architecture: str, configuration: Configuration) -> Client:
def load(configuration: Configuration) -> Client:
"""
load client from settings
:param architecture: repository architecture
:param configuration: configuration instance
:return: client according to current settings
"""
host = configuration.wrap("web", architecture, "host", configuration.get, fallback=None)
port = configuration.wrap("web", architecture, "port", configuration.getint, fallback=None)
host = configuration.get("web", "host", fallback=None)
port = configuration.getint("web", "port", fallback=None)
if host is None or port is None:
return Client()