From 899800b925f08592be12f9d47c8b3b6f293e223f Mon Sep 17 00:00:00 2001 From: Blake Harnden <32446120+bharnden@users.noreply.github.com> Date: Thu, 13 Apr 2023 16:43:09 -0700 Subject: [PATCH] daemon/gui: coverted remaining usages of old string formatting to f strings --- daemon/core/configservice/dependencies.py | 12 ++++++------ daemon/core/gui/graph/tooltip.py | 6 +++--- daemon/core/gui/tooltip.py | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/daemon/core/configservice/dependencies.py b/daemon/core/configservice/dependencies.py index 0bc5d4b6..1fbc4e48 100644 --- a/daemon/core/configservice/dependencies.py +++ b/daemon/core/configservice/dependencies.py @@ -54,8 +54,8 @@ class ConfigServiceDependencies: if self.started != set(self.node_services): raise ValueError( - "failure to start all services: %s != %s" - % (self.started, self.node_services.keys()) + f"failure to start all services: {self.started} != " + f"{self.node_services.keys()}" ) return paths @@ -96,14 +96,14 @@ class ConfigServiceDependencies: for service_name in current_service.dependencies: if service_name not in self.node_services: raise ValueError( - "required dependency was not included in node services: %s" - % service_name + "required dependency was not included in node " + f"services: {service_name}" ) if service_name in self.visiting: raise ValueError( - "cyclic dependency at service(%s): %s" - % (current_service.name, service_name) + f"cyclic dependency at service({current_service.name}): " + f"{service_name}" ) if service_name not in self.visited: diff --git a/daemon/core/gui/graph/tooltip.py b/daemon/core/gui/graph/tooltip.py index 37e7ac5d..b820abec 100644 --- a/daemon/core/gui/graph/tooltip.py +++ b/daemon/core/gui/graph/tooltip.py @@ -29,7 +29,7 @@ class CanvasTooltip: *, pad: tuple[int, int, int, int] = (5, 3, 5, 3), waittime: int = 400, - wraplength: int = 600 + wraplength: int = 600, ) -> None: # in miliseconds, originally 500 self.waittime: int = waittime @@ -64,7 +64,7 @@ class CanvasTooltip: label: ttk.Label, *, tip_delta: tuple[int, int] = (10, 5), - pad: tuple[int, int, int, int] = (5, 3, 5, 3) + pad: tuple[int, int, int, int] = (5, 3, 5, 3), ): c = canvas s_width, s_height = c.winfo_screenwidth(), c.winfo_screenheight() @@ -112,7 +112,7 @@ class CanvasTooltip: ) label.grid(padx=(pad[0], pad[2]), pady=(pad[1], pad[3]), sticky=tk.NSEW) x, y = tip_pos_calculator(canvas, label, pad=pad) - self.tw.wm_geometry("+%d+%d" % (x, y)) + self.tw.wm_geometry(f"+{x:d}+{y:d}") def hide(self) -> None: if self.tw: diff --git a/daemon/core/gui/tooltip.py b/daemon/core/gui/tooltip.py index f80dbe3f..6d84ac75 100644 --- a/daemon/core/gui/tooltip.py +++ b/daemon/core/gui/tooltip.py @@ -42,7 +42,7 @@ class Tooltip: y += self.widget.winfo_rooty() + 32 self.tw = tk.Toplevel(self.widget) self.tw.wm_overrideredirect(True) - self.tw.wm_geometry("+%d+%d" % (x, y)) + self.tw.wm_geometry(f"+{x:d}+{y:d}") self.tw.rowconfigure(0, weight=1) self.tw.columnconfigure(0, weight=1) frame = ttk.Frame(self.tw, style=Styles.tooltip_frame, padding=3)