From 01f2cf77512d47b3677b0385fbc9ab064443a073 Mon Sep 17 00:00:00 2001 From: ave Date: Tue, 24 May 2022 23:29:46 +0200 Subject: [PATCH] black pass --- robocop_ng/__init__.py | 1 + robocop_ng/cogs/basic.py | 4 +--- robocop_ng/cogs/yubicootp.py | 9 +++++---- robocop_ng/config_template.py | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/robocop_ng/__init__.py b/robocop_ng/__init__.py index 000a16d..99e0eb3 100755 --- a/robocop_ng/__init__.py +++ b/robocop_ng/__init__.py @@ -235,5 +235,6 @@ async def main(): log.exception(f"Failed to load cog {cog}.") await bot.start(config.token) + if __name__ == "__main__": asyncio.run(main()) diff --git a/robocop_ng/cogs/basic.py b/robocop_ng/cogs/basic.py index 48e6874..78b2da9 100644 --- a/robocop_ng/cogs/basic.py +++ b/robocop_ng/cogs/basic.py @@ -56,9 +56,7 @@ class Basic(Cog): rtt_ms = (after - before) * 1000 gw_ms = self.bot.latency * 1000 - message_text = ( - f":ping_pong:\nrtt: `{rtt_ms:.1f}ms`\ngw: `{gw_ms:.1f}ms`" - ) + message_text = f":ping_pong:\nrtt: `{rtt_ms:.1f}ms`\ngw: `{gw_ms:.1f}ms`" self.bot.log.info(message_text) await tmp.edit(content=message_text) diff --git a/robocop_ng/cogs/yubicootp.py b/robocop_ng/cogs/yubicootp.py index b322889..6599987 100644 --- a/robocop_ng/cogs/yubicootp.py +++ b/robocop_ng/cogs/yubicootp.py @@ -84,15 +84,16 @@ class YubicoOTP(Cog): resp = await self.bot.aiosession.get(url) assert resp.status == 200 except Exception as ex: - self.bot.log.warning( - f"Got {repr(ex)} on {api_server} with otp {otp}." - ) + self.bot.log.warning(f"Got {repr(ex)} on {api_server} with otp {otp}.") continue resptext = await resp.text() # Turn the fields to a python dict for easier parsing datafields = resptext.strip().split("\r\n") - datafields = {line[:line.index("=")]: line[line.index("=") + 1:] for line in datafields} + datafields = { + line[: line.index("=")]: line[line.index("=") + 1 :] + for line in datafields + } # Verify nonce assert datafields["nonce"] == nonce diff --git a/robocop_ng/config_template.py b/robocop_ng/config_template.py index e92a3b4..9bc1bce 100644 --- a/robocop_ng/config_template.py +++ b/robocop_ng/config_template.py @@ -39,7 +39,7 @@ initial_cogs = [ "cogs.robocronp", "cogs.meme", "cogs.invites", - "cogs.yubicootp" + "cogs.yubicootp", ] # The following cogs are also available but aren't loaded by default: