with opening reduced
This commit is contained in:
parent
53f66ea76d
commit
6f02724daa
30
wirepy.py
30
wirepy.py
@ -73,12 +73,12 @@ class Wirepy(tk.Tk):
|
|||||||
|
|
||||||
self.style = ttk.Style(self)
|
self.style = ttk.Style(self)
|
||||||
self.tk.call("source", f"{tcl_path}/water.tcl")
|
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:
|
if "light\n" in lines:
|
||||||
self.tk.call("set_theme", "light")
|
self.tk.call("set_theme", "light")
|
||||||
else:
|
else:
|
||||||
self.tk.call("set_theme", "dark")
|
self.tk.call("set_theme", "dark")
|
||||||
|
|
||||||
# Load the image file from the disk
|
# Load the image file from the disk
|
||||||
self.wg_icon = tk.PhotoImage(file=r"/usr/share/icons/lx-icons/48/wg_vpn.png")
|
self.wg_icon = tk.PhotoImage(file=r"/usr/share/icons/lx-icons/48/wg_vpn.png")
|
||||||
@ -436,10 +436,8 @@ class FrameWidgets(ttk.Frame):
|
|||||||
self.l_box.delete(self.select_tunnel[0])
|
self.l_box.delete(self.select_tunnel[0])
|
||||||
with open(set_file, "r", encoding="utf-8") as set_f6:
|
with open(set_file, "r", encoding="utf-8") as set_f6:
|
||||||
lines6 = set_f6.readlines()
|
lines6 = set_f6.readlines()
|
||||||
if (
|
if (select_tl == lines6[7].strip()
|
||||||
select_tl == lines6[7].strip()
|
and "off\n" not in lines6[7].strip()):
|
||||||
and "off\n" not in lines6[7].strip()
|
|
||||||
):
|
|
||||||
lines6[7] = "off\n"
|
lines6[7] = "off\n"
|
||||||
with open(set_file, "w", encoding="utf-8") as set_f7:
|
with open(set_file, "w", encoding="utf-8") as set_f7:
|
||||||
set_f7.writelines(lines6)
|
set_f7.writelines(lines6)
|
||||||
@ -805,14 +803,12 @@ class FrameWidgets(ttk.Frame):
|
|||||||
"""
|
"""
|
||||||
View activ Tunnel in the color green or yellow
|
View activ Tunnel in the color green or yellow
|
||||||
"""
|
"""
|
||||||
|
lines = set_file.read_text()
|
||||||
|
if "light\n" in lines:
|
||||||
|
self.lb_tunnel = ttk.Label(self, textvariable=self.str_var, foreground="green")
|
||||||
|
|
||||||
with open(set_file, "r", encoding="utf-8") as read_file:
|
else:
|
||||||
lines = read_file.readlines()
|
self.lb_tunnel = ttk.Label(self, textvariable=self.str_var, foreground="yellow")
|
||||||
if "light\n" in lines:
|
|
||||||
self.lb_tunnel = ttk.Label(self, textvariable=self.str_var, foreground="green")
|
|
||||||
|
|
||||||
else:
|
|
||||||
self.lb_tunnel = ttk.Label(self, textvariable=self.str_var, foreground="yellow")
|
|
||||||
|
|
||||||
self.lb_tunnel.config(font=("Ubuntu", 11, "bold"))
|
self.lb_tunnel.config(font=("Ubuntu", 11, "bold"))
|
||||||
self.lb_tunnel.grid(column=2, padx=10, row=1)
|
self.lb_tunnel.grid(column=2, padx=10, row=1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user