From 39b511c9cd04fd37caf6fe330d15d547f1beb600 Mon Sep 17 00:00:00 2001 From: Shane Jaroch Date: Fri, 19 Apr 2024 13:49:33 -0400 Subject: [PATCH] no f-string --- ntclient/services/api/__init__.py | 6 +++--- ntclient/services/bugs.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ntclient/services/api/__init__.py b/ntclient/services/api/__init__.py index a98e434..37b399a 100644 --- a/ntclient/services/api/__init__.py +++ b/ntclient/services/api/__init__.py @@ -30,10 +30,10 @@ def cache_mirrors() -> str: _res.raise_for_status() # TODO: save in persistence config.ini - print(f"INFO: mirror SUCCESS '{mirror}'") + print("INFO: mirror SUCCESS '%s'" % mirror) return mirror except (requests.exceptions.ConnectionError, requests.exceptions.HTTPError): - print(f"WARN: mirror FAILURE '{mirror}'") + print("WARN: mirror FAILURE '%s'" % mirror) return str() @@ -49,7 +49,7 @@ class ApiClient: def post(self, path: str, data: dict) -> requests.Response: """Post data to the API.""" _res = requests.post( - f"{self.host}/{path}", + self.host + "/" + path, json=data, timeout=(REQUEST_CONNECT_TIMEOUT, REQUEST_READ_TIMEOUT), ) diff --git a/ntclient/services/bugs.py b/ntclient/services/bugs.py index 7843aff..a122cfb 100644 --- a/ntclient/services/bugs.py +++ b/ntclient/services/bugs.py @@ -56,7 +56,7 @@ INSERT INTO bug ), ) except sqlite3.IntegrityError as exc: - print(f"WARN: {repr(exc)}") + print("WARN: %s" % repr(exc)) dupe_bug_insertion_exc = ( "IntegrityError('UNIQUE constraint failed: bug.arguments, bug.stack')" ) @@ -80,8 +80,8 @@ def list_bugs(show_all: bool) -> tuple: n_bugs_total = len(bugs) n_bugs_unsubmitted = len([x for x in bugs if not bool(x["submitted"])]) - print(f"You have: {n_bugs_total} total bugs amassed in your journey.") - print(f"Of these, {n_bugs_unsubmitted} require submission/reporting.") + print("You have: %s total bugs amassed in your journey." % n_bugs_total) + print("Of these, %s require submission/reporting." % n_bugs_unsubmitted) print() for bug in bugs: @@ -117,7 +117,7 @@ def submit_bugs() -> int: api_client = ntclient.services.api.ApiClient() n_submitted = 0 - print(f"submitting {len(bugs)} bug reports...") + print("submitting %s bug reports..." % len(bugs)) print("_" * len(bugs)) for bug in bugs: -- 2.52.0