From 9987bb87db4b8e5979acfb45bcaee2a9cf94443e Mon Sep 17 00:00:00 2001 From: Xiretza Date: Sun, 27 Mar 2022 19:35:40 +0200 Subject: [PATCH] Run black --- its_matrix_bot/__main__.py | 3 ++- its_matrix_bot/config.py | 12 ++++++------ its_matrix_bot/its_api.py | 6 ++++-- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/its_matrix_bot/__main__.py b/its_matrix_bot/__main__.py index ac00437..d3dafd9 100644 --- a/its_matrix_bot/__main__.py +++ b/its_matrix_bot/__main__.py @@ -5,7 +5,8 @@ from .config import Config parser = argparse.ArgumentParser(description="IT-Syndikat matrix bot") parser.add_argument( - "-c", "--config", + "-c", + "--config", help="path to the config file", ) diff --git a/its_matrix_bot/config.py b/its_matrix_bot/config.py index e734e5c..d2425ec 100644 --- a/its_matrix_bot/config.py +++ b/its_matrix_bot/config.py @@ -16,11 +16,11 @@ class Config: config = toml.load(path) - self.command_prefix = config['app']['command_prefix'] + self.command_prefix = config["app"]["command_prefix"] - matrix = config['matrix'] - self.matrix_homeserver = matrix['homeserver'] - self.matrix_username = matrix['username'] - self.matrix_access_token = matrix['access_token'] + matrix = config["matrix"] + self.matrix_homeserver = matrix["homeserver"] + self.matrix_username = matrix["username"] + self.matrix_access_token = matrix["access_token"] - self.spaceping_token = config['spaceping']['api_token'] + self.spaceping_token = config["spaceping"]["api_token"] diff --git a/its_matrix_bot/its_api.py b/its_matrix_bot/its_api.py index 9186cf1..0bf6d2e 100644 --- a/its_matrix_bot/its_api.py +++ b/its_matrix_bot/its_api.py @@ -2,6 +2,7 @@ import aiohttp from .config import Config + class ItSyndikatApi: base_url: str config: Config @@ -15,10 +16,11 @@ class ItSyndikatApi: async with session.get(self.base_url + "status.php") as response: return await response.json() - async def ping(self): params = {"apikey": self.config.spaceping_token} async with aiohttp.ClientSession() as session: - async with session.post(self.base_url + "ping.php", params=params) as response: + async with session.post( + self.base_url + "ping.php", params=params + ) as response: await response.text()