From d5e1060e945dbaeb144b3768b9a6894c706ecf2d Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Tue, 30 Jan 2024 00:11:11 +0000 Subject: [PATCH] [autofix.ci] apply automated fixes --- r8/__init__.py | 1 + r8/challenge_mixins/web_server.py | 6 +++--- r8/util.py | 24 ++++++++++++------------ 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/r8/__init__.py b/r8/__init__.py index 602cf2c..306cd1e 100644 --- a/r8/__init__.py +++ b/r8/__init__.py @@ -1,6 +1,7 @@ """ The public API of r8 that is exposed to challenges. """ + import sqlite3 from collections.abc import Mapping from typing import Any diff --git a/r8/challenge_mixins/web_server.py b/r8/challenge_mixins/web_server.py index fb0f6f5..dda0a6b 100644 --- a/r8/challenge_mixins/web_server.py +++ b/r8/challenge_mixins/web_server.py @@ -21,9 +21,9 @@ def log_nonsafe(request: web.Request) -> bool: class WebServerChallenge(r8.Challenge): runner: web.AppRunner = None - log_web_requests: Union[ - bool, Callable[[web.Request], bool] - ] = lambda self, x: log_nonstatic(x) + log_web_requests: Union[bool, Callable[[web.Request], bool]] = ( + lambda self, x: log_nonstatic(x) + ) @property @abc.abstractmethod diff --git a/r8/util.py b/r8/util.py index 485f91f..ec3df49 100644 --- a/r8/util.py +++ b/r8/util.py @@ -647,9 +647,9 @@ async def get_challenges(user: str): challenge["title"] = challenge["cid"] challenge["visible"] = True challenge["tags"] = [] - challenge[ - "description" - ] = f"
{html.escape(traceback.format_exc())}" + challenge["description"] = ( + f"
{html.escape(traceback.format_exc())}" + ) continue try: @@ -659,18 +659,18 @@ async def get_challenges(user: str): except Exception: challenge["visible"] = True challenge["tags"] = [] - challenge[ - "description" - ] = f"
{html.escape(traceback.format_exc())}" + challenge["description"] = ( + f"
{html.escape(traceback.format_exc())}" + ) continue try: challenge["tags"] = [str(x) for x in inst.tags] except Exception: challenge["tags"] = [] - challenge[ - "description" - ] = f"
{html.escape(traceback.format_exc())}" + challenge["description"] = ( + f"
{html.escape(traceback.format_exc())}" + ) continue try: @@ -678,9 +678,9 @@ async def get_challenges(user: str): user, bool(challenge["solve_time"]) ) except Exception: - challenge[ - "description" - ] = f"
{html.escape(traceback.format_exc())}" + challenge["description"] = ( + f"
{html.escape(traceback.format_exc())}" + ) challenge["points"] = scoring.challenge_points(inst, challenge["solves"])