daemon/gui: coverted remaining usages of old string formatting to f strings
This commit is contained in:
parent
4dba1bbe32
commit
899800b925
3 changed files with 10 additions and 10 deletions
|
@ -54,8 +54,8 @@ class ConfigServiceDependencies:
|
||||||
|
|
||||||
if self.started != set(self.node_services):
|
if self.started != set(self.node_services):
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"failure to start all services: %s != %s"
|
f"failure to start all services: {self.started} != "
|
||||||
% (self.started, self.node_services.keys())
|
f"{self.node_services.keys()}"
|
||||||
)
|
)
|
||||||
|
|
||||||
return paths
|
return paths
|
||||||
|
@ -96,14 +96,14 @@ class ConfigServiceDependencies:
|
||||||
for service_name in current_service.dependencies:
|
for service_name in current_service.dependencies:
|
||||||
if service_name not in self.node_services:
|
if service_name not in self.node_services:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"required dependency was not included in node services: %s"
|
"required dependency was not included in node "
|
||||||
% service_name
|
f"services: {service_name}"
|
||||||
)
|
)
|
||||||
|
|
||||||
if service_name in self.visiting:
|
if service_name in self.visiting:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"cyclic dependency at service(%s): %s"
|
f"cyclic dependency at service({current_service.name}): "
|
||||||
% (current_service.name, service_name)
|
f"{service_name}"
|
||||||
)
|
)
|
||||||
|
|
||||||
if service_name not in self.visited:
|
if service_name not in self.visited:
|
||||||
|
|
|
@ -29,7 +29,7 @@ class CanvasTooltip:
|
||||||
*,
|
*,
|
||||||
pad: tuple[int, int, int, int] = (5, 3, 5, 3),
|
pad: tuple[int, int, int, int] = (5, 3, 5, 3),
|
||||||
waittime: int = 400,
|
waittime: int = 400,
|
||||||
wraplength: int = 600
|
wraplength: int = 600,
|
||||||
) -> None:
|
) -> None:
|
||||||
# in miliseconds, originally 500
|
# in miliseconds, originally 500
|
||||||
self.waittime: int = waittime
|
self.waittime: int = waittime
|
||||||
|
@ -64,7 +64,7 @@ class CanvasTooltip:
|
||||||
label: ttk.Label,
|
label: ttk.Label,
|
||||||
*,
|
*,
|
||||||
tip_delta: tuple[int, int] = (10, 5),
|
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
|
c = canvas
|
||||||
s_width, s_height = c.winfo_screenwidth(), c.winfo_screenheight()
|
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)
|
label.grid(padx=(pad[0], pad[2]), pady=(pad[1], pad[3]), sticky=tk.NSEW)
|
||||||
x, y = tip_pos_calculator(canvas, label, pad=pad)
|
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:
|
def hide(self) -> None:
|
||||||
if self.tw:
|
if self.tw:
|
||||||
|
|
|
@ -42,7 +42,7 @@ class Tooltip:
|
||||||
y += self.widget.winfo_rooty() + 32
|
y += self.widget.winfo_rooty() + 32
|
||||||
self.tw = tk.Toplevel(self.widget)
|
self.tw = tk.Toplevel(self.widget)
|
||||||
self.tw.wm_overrideredirect(True)
|
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.rowconfigure(0, weight=1)
|
||||||
self.tw.columnconfigure(0, weight=1)
|
self.tw.columnconfigure(0, weight=1)
|
||||||
frame = ttk.Frame(self.tw, style=Styles.tooltip_frame, padding=3)
|
frame = ttk.Frame(self.tw, style=Styles.tooltip_frame, padding=3)
|
||||||
|
|
Loading…
Reference in a new issue