fix in converter and fix in import for no valid files
This commit is contained in:
28
wirepy.py
28
wirepy.py
@ -54,7 +54,6 @@ def signal_handler(signum, frame):
|
||||
signame = signals_to_names_dict.get(signum, f"Unnamed signal: {signum}")
|
||||
|
||||
# End program for certain signals, report to others only reception
|
||||
|
||||
if signum in (signal.SIGINT, signal.SIGTERM):
|
||||
exit_code = 1
|
||||
print(
|
||||
@ -99,7 +98,6 @@ class Wirepy(tk.Tk):
|
||||
|
||||
self.style = ttk.Style(self)
|
||||
self.tk.call("source", str(tcl_path) + "/water.tcl")
|
||||
# self.tk.call('source', 'TK-Themes/water.tcl')
|
||||
with open(wg_set, "r", encoding="utf-8") as read_file:
|
||||
lines = read_file.readlines()
|
||||
if "light\n" in lines:
|
||||
@ -248,13 +246,13 @@ class FrameWidgets(ttk.Frame):
|
||||
The mouse moves from the entry widget
|
||||
Remove Tool-Tip
|
||||
"""
|
||||
window.my_tool_tip.destroy()
|
||||
window.my_tool_tip.destroy()
|
||||
|
||||
# App Menu
|
||||
self.version_lb = ttk.Label(self.menu_frame, text=VERSION)
|
||||
self.version_lb.config(font=("Ubuntu", 11), foreground="#00c4ff")
|
||||
self.version_lb.grid(column=0, row=0, rowspan=4, padx=10)
|
||||
|
||||
|
||||
self.options_btn = ttk.Menubutton(self.menu_frame, text=_("Options"))
|
||||
self.options_btn.grid(column=1, columnspan=1, row=0)
|
||||
|
||||
@ -301,6 +299,7 @@ class FrameWidgets(ttk.Frame):
|
||||
# Update and Tooltip Label
|
||||
self.updates_lb = ttk.Label(self.menu_frame)
|
||||
self.updates_lb.grid(column=4, columnspan=3, row=0, padx=10)
|
||||
|
||||
# View Checkbox for enable or disable Tooltip
|
||||
if WG_TIPS:
|
||||
set_tip.set(value=False)
|
||||
@ -605,7 +604,6 @@ class FrameWidgets(ttk.Frame):
|
||||
self.wg_autostart.configure(state="disabled")
|
||||
|
||||
# for disable checkbox when Listbox empty
|
||||
|
||||
def empty_list_start_enter(event):
|
||||
"""
|
||||
The mouse moves into the entry widget
|
||||
@ -908,6 +906,7 @@ class FrameWidgets(ttk.Frame):
|
||||
self.selected_option = tk.IntVar()
|
||||
self.autoconnect_var = tk.StringVar()
|
||||
self.autoconnect_var.set(self.auto_con)
|
||||
|
||||
# Frame for Labels, Entry and Button
|
||||
self.autoconnect = ttk.Label(
|
||||
self.lb_frame3, textvariable=self.autoconnect_var, width=15
|
||||
@ -1037,6 +1036,7 @@ class FrameWidgets(ttk.Frame):
|
||||
) as readfile:
|
||||
p_key = readfile.readlines()
|
||||
if pre_key in p_key or pre_key + "\n" in p_key:
|
||||
|
||||
# img_w, img_i, w_title, w_txt hand over
|
||||
iw = r"/usr/share/icons/lx-icons/64/error.png"
|
||||
ii = r"/usr/share/icons/lx-icons/48/wg_msg.png"
|
||||
@ -1254,7 +1254,10 @@ class FrameWidgets(ttk.Frame):
|
||||
)
|
||||
Path.chmod(wg_read, 0o600)
|
||||
|
||||
if "PrivateKey = " and "Endpoint = " not in read:
|
||||
if ("PrivateKey = " in read) and ("Endpoint = " in read):
|
||||
pass
|
||||
else:
|
||||
|
||||
# img_w, img_i, w_title, w_txt hand over
|
||||
iw = r"/usr/share/icons/lx-icons/64/error.png"
|
||||
ii = r"/usr/share/icons/lx-icons/48/wg_msg.png"
|
||||
@ -1264,12 +1267,12 @@ class FrameWidgets(ttk.Frame):
|
||||
)
|
||||
msg_window(iw, ii, wt, msg_t)
|
||||
|
||||
except EOFError:
|
||||
pass
|
||||
except TypeError:
|
||||
pass
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
except EOFError as e:
|
||||
print(e)
|
||||
except TypeError as e:
|
||||
print(e)
|
||||
except FileNotFoundError as e:
|
||||
print(e)
|
||||
except subprocess.CalledProcessError:
|
||||
|
||||
print("Tunnel exist!")
|
||||
@ -1366,6 +1369,7 @@ class FrameWidgets(ttk.Frame):
|
||||
"""
|
||||
shows data in the label
|
||||
"""
|
||||
|
||||
# Address Label
|
||||
self.address = ttk.Label(
|
||||
self.lb_frame, textvariable=self.add, foreground="#0071ff"
|
||||
|
Reference in New Issue
Block a user