with opening reduced

This commit is contained in:
Désiré Werner Menrath 2025-04-29 09:02:06 +02:00
parent 53f66ea76d
commit 6f02724daa

View File

@ -73,8 +73,8 @@ class Wirepy(tk.Tk):
self.style = ttk.Style(self)
self.tk.call("source", f"{tcl_path}/water.tcl")
with open(set_file, "r", encoding="utf-8") as read_file:
lines = read_file.readlines()
lines = set_file.read_text()
if "light\n" in lines:
self.tk.call("set_theme", "light")
else:
@ -436,10 +436,8 @@ class FrameWidgets(ttk.Frame):
self.l_box.delete(self.select_tunnel[0])
with open(set_file, "r", encoding="utf-8") as set_f6:
lines6 = set_f6.readlines()
if (
select_tl == lines6[7].strip()
and "off\n" not in lines6[7].strip()
):
if (select_tl == lines6[7].strip()
and "off\n" not in lines6[7].strip()):
lines6[7] = "off\n"
with open(set_file, "w", encoding="utf-8") as set_f7:
set_f7.writelines(lines6)
@ -805,9 +803,7 @@ class FrameWidgets(ttk.Frame):
"""
View activ Tunnel in the color green or yellow
"""
with open(set_file, "r", encoding="utf-8") as read_file:
lines = read_file.readlines()
lines = set_file.read_text()
if "light\n" in lines:
self.lb_tunnel = ttk.Label(self, textvariable=self.str_var, foreground="green")