]> Nutra Git (v1) - nutratech/cli.git/commitdiff
no f-string
authorShane Jaroch <chown_tee@proton.me>
Fri, 19 Apr 2024 17:49:33 +0000 (13:49 -0400)
committerShane Jaroch <chown_tee@proton.me>
Fri, 19 Apr 2024 17:49:33 +0000 (13:49 -0400)
ntclient/services/api/__init__.py
ntclient/services/bugs.py

index a98e43447a1e5ac8cfe66b1443e6523e3ebb969e..37b399aea9de16ec8219e13dfa9aaddcc9efb433 100644 (file)
@@ -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),
         )
index 7843afff75aab33020fafb890fbb39b16a50591f..a122cfbf08cee34cb438da9ca41a3ce8e917b773 100644 (file)
@@ -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: