Class LxTools expands wg_set to set_file renamed
This commit is contained in:
parent
87943b2489
commit
d2a57b329b
Binary file not shown.
248
cls_mth_fc.py
248
cls_mth_fc.py
@ -23,7 +23,7 @@ gettext.bindtextdomain(APP, LOCALE_DIR)
|
|||||||
gettext.textdomain(APP)
|
gettext.textdomain(APP)
|
||||||
_ = gettext.gettext
|
_ = gettext.gettext
|
||||||
|
|
||||||
wg_set = Path(Path.home() / ".config/wire_py/settings")
|
#wg_set = Path(Path.home() / ".config/wire_py/settings")
|
||||||
|
|
||||||
|
|
||||||
class Create:
|
class Create:
|
||||||
@ -135,30 +135,30 @@ class LxTools(tk.Tk):
|
|||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
def theme_change_light(self):
|
def theme_change_light(self, file=None):
|
||||||
"""
|
"""
|
||||||
Set light theme
|
Set light theme
|
||||||
"""
|
"""
|
||||||
if self.tk.call("ttk::style", "theme", "use") == "water-dark":
|
if self.tk.call("ttk::style", "theme", "use") == "water-dark":
|
||||||
self.tk.call("set_theme", "light")
|
self.tk.call("set_theme", "light")
|
||||||
with open(wg_set, "r", encoding="utf-8") as theme_set2:
|
with open(file, "r", encoding="utf-8") as theme_set2:
|
||||||
lines3 = theme_set2.readlines()
|
lines3 = theme_set2.readlines()
|
||||||
lines3[3] = "light\n"
|
lines3[3] = "light\n"
|
||||||
with open(wg_set, "w", encoding="utf-8") as theme_set2:
|
with open(file, "w", encoding="utf-8") as theme_set2:
|
||||||
theme_set2.writelines(lines3)
|
theme_set2.writelines(lines3)
|
||||||
self.color_label()
|
self.color_label()
|
||||||
|
|
||||||
|
|
||||||
def theme_change_dark(self):
|
def theme_change_dark(self, file=None):
|
||||||
"""
|
"""
|
||||||
Set dark theme
|
Set dark theme
|
||||||
"""
|
"""
|
||||||
if not self.tk.call("ttk::style", "theme", "use") == "water-dark":
|
if not self.tk.call("ttk::style", "theme", "use") == "water-dark":
|
||||||
self.tk.call("set_theme", "dark")
|
self.tk.call("set_theme", "dark")
|
||||||
with open(wg_set, "r", encoding="utf-8") as theme_set2:
|
with open(file, "r", encoding="utf-8") as theme_set2:
|
||||||
lines4 = theme_set2.readlines()
|
lines4 = theme_set2.readlines()
|
||||||
lines4[3] = "dark\n"
|
lines4[3] = "dark\n"
|
||||||
with open(wg_set, "w", encoding="utf-8") as theme_set2:
|
with open(file, "w", encoding="utf-8") as theme_set2:
|
||||||
theme_set2.writelines(lines4)
|
theme_set2.writelines(lines4)
|
||||||
self.color_label()
|
self.color_label()
|
||||||
|
|
||||||
@ -176,77 +176,30 @@ class LxTools(tk.Tk):
|
|||||||
with open(file, "w", encoding="utf-8") as f:
|
with open(file, "w", encoding="utf-8") as f:
|
||||||
f.write(logname)
|
f.write(logname)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
class GiteaUpdate:
|
def clean_files(dirname=None, path=None):
|
||||||
"""
|
if dirname != None:
|
||||||
Calling download requests the download URL of the running script,
|
shutil.rmtree(dirname)
|
||||||
the taskbar image for the “Download OK” window, the taskbar image for the
|
if path != None:
|
||||||
“Download error” window and the variable res
|
Path.unlink(f"{path}")
|
||||||
"""
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def api_down(update_api_url, version):
|
def if_tip(path):
|
||||||
"""
|
"""
|
||||||
Calling api_down requests the URL and the version of the running script.
|
method that writes in file whether tooltip is displayed or not
|
||||||
Example: version = 'v. 1.1.1.1' GiteaUpdate.api_down(http://example.de, version)
|
|
||||||
"""
|
"""
|
||||||
try:
|
with open(path, "r", encoding="utf-8") as set_f2:
|
||||||
response = requests.get(update_api_url, timeout=10)
|
lines2 = set_f2.readlines()
|
||||||
response_dict = response.json()
|
if "False\n" in lines2:
|
||||||
response_dict = response_dict[0]
|
tip = False
|
||||||
with open(wg_set, "r", encoding="utf-8") as set_f:
|
|
||||||
set_f = set_f.read()
|
|
||||||
if "on\n" in set_f:
|
|
||||||
if version[3:] != response_dict["tag_name"]:
|
|
||||||
req = response_dict["tag_name"]
|
|
||||||
else:
|
else:
|
||||||
req = "No Updates"
|
tip = True
|
||||||
else:
|
return tip
|
||||||
req = "False"
|
|
||||||
return req
|
|
||||||
except requests.exceptions.RequestException:
|
|
||||||
req = "No Internet Connection!"
|
|
||||||
return req
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def download(urld, down_ok_image, down_not_ok_image, res):
|
|
||||||
"""
|
|
||||||
this is for download new Version of wirepy
|
|
||||||
"""
|
|
||||||
try:
|
|
||||||
to_down = f"wget -qP {Path.home()} {" "} {urld}"
|
|
||||||
result = subprocess.call(to_down, shell=True)
|
|
||||||
if result == 0:
|
|
||||||
shutil.chown(f"{Path.home()}/{res}.zip", 1000, 1000)
|
|
||||||
|
|
||||||
# img_w, img_i, w_title, w_txt hand over
|
|
||||||
iw = r"/usr/share/icons/lx-icons/64/info.png"
|
|
||||||
ii = down_ok_image
|
|
||||||
wt = _("Download Successful")
|
|
||||||
msg_t = _("Your zip file is in home directory")
|
|
||||||
msg_window(iw, ii, wt, msg_t)
|
|
||||||
|
|
||||||
else:
|
|
||||||
|
|
||||||
# img_w, img_i, w_title, w_txt hand over
|
|
||||||
iw = r"/usr/share/icons/lx-icons/64/error.png"
|
|
||||||
ii = down_not_ok_image
|
|
||||||
wt = _("Download error")
|
|
||||||
msg_t = _("Download failed! Please try again")
|
|
||||||
msg_window(iw, ii, wt, msg_t)
|
|
||||||
except subprocess.CalledProcessError:
|
|
||||||
|
|
||||||
# img_w, img_i, w_title, w_txt hand over
|
|
||||||
iw = r"/usr/share/icons/lx-icons/64/error.png"
|
|
||||||
ii = down_not_ok_image
|
|
||||||
wt = _("Download error")
|
|
||||||
msg_t = _("Download failed! No internet connection!")
|
|
||||||
msg_window(iw, ii, wt, msg_t)
|
|
||||||
|
|
||||||
|
|
||||||
def msg_window(img_w, img_i, w_title, w_txt, txt2=None, com=None):
|
def msg_window(img_w, img_i, w_title, w_txt, txt2=None, com=None):
|
||||||
"""
|
"""
|
||||||
Function for different message windows for the user. with 4 arguments to be passed.
|
Method for different message windows for the user. with 4 arguments to be passed.
|
||||||
To create messages with your own images, icons, and titles.
|
To create messages with your own images, icons, and titles.
|
||||||
As an alternative to Python Messagebox.
|
As an alternative to Python Messagebox.
|
||||||
Paths to images must be specified: r'/usr/share/icons/lx-icons/64/info.png'
|
Paths to images must be specified: r'/usr/share/icons/lx-icons/64/info.png'
|
||||||
@ -288,6 +241,109 @@ def msg_window(img_w, img_i, w_title, w_txt, txt2=None, com=None):
|
|||||||
msg.rowconfigure(0, weight=1)
|
msg.rowconfigure(0, weight=1)
|
||||||
msg.winfo_toplevel()
|
msg.winfo_toplevel()
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def sigi(dirname=None, path=None):
|
||||||
|
"""
|
||||||
|
function for clean up after break
|
||||||
|
"""
|
||||||
|
|
||||||
|
def signal_handler(signum, frame):
|
||||||
|
"""
|
||||||
|
Determine clear text names for signal numbers
|
||||||
|
"""
|
||||||
|
signals_to_names_dict = dict(
|
||||||
|
(getattr(signal, n), n)
|
||||||
|
for n in dir(signal)
|
||||||
|
if n.startswith("SIG") and "_" not in n
|
||||||
|
)
|
||||||
|
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(
|
||||||
|
f"\nSignal {signame} {(signum)} received. => Aborting with exit code {exit_code}."
|
||||||
|
)
|
||||||
|
LxTools.clean_files(dirname)
|
||||||
|
print("Breakdown by user...")
|
||||||
|
sys.exit(exit_code)
|
||||||
|
else:
|
||||||
|
print(f"Signal {signum} received and ignored.")
|
||||||
|
LxTools.clean_files(dirname)
|
||||||
|
print("Process unexpectedly ended...")
|
||||||
|
|
||||||
|
signal.signal(signal.SIGINT, signal_handler)
|
||||||
|
signal.signal(signal.SIGTERM, signal_handler)
|
||||||
|
signal.signal(signal.SIGHUP, signal_handler)
|
||||||
|
|
||||||
|
|
||||||
|
class GiteaUpdate:
|
||||||
|
"""
|
||||||
|
Calling download requests the download URL of the running script,
|
||||||
|
the taskbar image for the “Download OK” window, the taskbar image for the
|
||||||
|
“Download error” window and the variable res
|
||||||
|
"""
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def api_down(update_api_url, version, file=None):
|
||||||
|
"""
|
||||||
|
Calling api_down requests the URL and the version of the running script.
|
||||||
|
Example: version = 'v. 1.1.1.1' GiteaUpdate.api_down(http://example.de, version)
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
response = requests.get(update_api_url, timeout=10)
|
||||||
|
response_dict = response.json()
|
||||||
|
response_dict = response_dict[0]
|
||||||
|
with open(file, "r", encoding="utf-8") as set_f:
|
||||||
|
set_f = set_f.read()
|
||||||
|
if "on\n" in set_f:
|
||||||
|
if version[3:] != response_dict["tag_name"]:
|
||||||
|
req = response_dict["tag_name"]
|
||||||
|
else:
|
||||||
|
req = "No Updates"
|
||||||
|
else:
|
||||||
|
req = "False"
|
||||||
|
return req
|
||||||
|
except requests.exceptions.RequestException:
|
||||||
|
req = "No Internet Connection!"
|
||||||
|
return req
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def download(urld, down_ok_image, down_not_ok_image, res):
|
||||||
|
"""
|
||||||
|
this is for download new Version of wirepy
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
to_down = f"wget -qP {Path.home()} {" "} {urld}"
|
||||||
|
result = subprocess.call(to_down, shell=True)
|
||||||
|
if result == 0:
|
||||||
|
shutil.chown(f"{Path.home()}/{res}.zip", 1000, 1000)
|
||||||
|
|
||||||
|
# img_w, img_i, w_title, w_txt hand over
|
||||||
|
iw = r"/usr/share/icons/lx-icons/64/info.png"
|
||||||
|
ii = down_ok_image
|
||||||
|
wt = _("Download Successful")
|
||||||
|
msg_t = _("Your zip file is in home directory")
|
||||||
|
LxTools.msg_window(iw, ii, wt, msg_t)
|
||||||
|
|
||||||
|
else:
|
||||||
|
|
||||||
|
# img_w, img_i, w_title, w_txt hand over
|
||||||
|
iw = r"/usr/share/icons/lx-icons/64/error.png"
|
||||||
|
ii = down_not_ok_image
|
||||||
|
wt = _("Download error")
|
||||||
|
msg_t = _("Download failed! Please try again")
|
||||||
|
LxTools.msg_window(iw, ii, wt, msg_t)
|
||||||
|
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
|
|
||||||
|
# img_w, img_i, w_title, w_txt hand over
|
||||||
|
iw = r"/usr/share/icons/lx-icons/64/error.png"
|
||||||
|
ii = down_not_ok_image
|
||||||
|
wt = _("Download error")
|
||||||
|
msg_t = _("Download failed! No internet connection!")
|
||||||
|
LxTools.msg_window(iw, ii, wt, msg_t)
|
||||||
|
|
||||||
|
|
||||||
class Tunnel:
|
class Tunnel:
|
||||||
"""
|
"""
|
||||||
@ -393,7 +449,7 @@ class Tunnel:
|
|||||||
ii = r"/usr/share/icons/lx-icons/48/wg_vpn.png"
|
ii = r"/usr/share/icons/lx-icons/48/wg_vpn.png"
|
||||||
wt = _("Export Successful")
|
wt = _("Export Successful")
|
||||||
msg_t = _("Your zip file is in home directory")
|
msg_t = _("Your zip file is in home directory")
|
||||||
msg_window(iw, ii, wt, msg_t)
|
LxTools.msg_window(iw, ii, wt, msg_t)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
@ -402,7 +458,7 @@ class Tunnel:
|
|||||||
ii = r"/usr/share/icons/lx-icons/48/wg_msg.png"
|
ii = r"/usr/share/icons/lx-icons/48/wg_msg.png"
|
||||||
wt = _("Export error")
|
wt = _("Export error")
|
||||||
msg_t = _("Export failed! Please try again")
|
msg_t = _("Export failed! Please try again")
|
||||||
msg_window(iw, ii, wt, msg_t)
|
LxTools.msg_window(iw, ii, wt, msg_t)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
@ -411,60 +467,12 @@ class Tunnel:
|
|||||||
ii = r"/usr/share/icons/lx-icons/48/wg_msg.png"
|
ii = r"/usr/share/icons/lx-icons/48/wg_msg.png"
|
||||||
wt = _("Select tunnel")
|
wt = _("Select tunnel")
|
||||||
msg_t = _("Please first import tunnel")
|
msg_t = _("Please first import tunnel")
|
||||||
msg_window(iw, ii, wt, msg_t)
|
LxTools.msg_window(iw, ii, wt, msg_t)
|
||||||
|
|
||||||
except TypeError:
|
except TypeError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def sigi(dirname):
|
|
||||||
"""
|
|
||||||
function for clean up after break
|
|
||||||
"""
|
|
||||||
|
|
||||||
def signal_handler(signum, frame):
|
|
||||||
"""
|
|
||||||
Determine clear text names for signal numbers
|
|
||||||
"""
|
|
||||||
signals_to_names_dict = dict(
|
|
||||||
(getattr(signal, n), n)
|
|
||||||
for n in dir(signal)
|
|
||||||
if n.startswith("SIG") and "_" not in n
|
|
||||||
)
|
|
||||||
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(
|
|
||||||
f"\nSignal {signame} {(signum)} received. => Aborting with exit code {exit_code}."
|
|
||||||
)
|
|
||||||
shutil.rmtree(dirname)
|
|
||||||
Path.unlink("/tmp/.loguser")
|
|
||||||
print("Breakdown by user...")
|
|
||||||
sys.exit(exit_code)
|
|
||||||
else:
|
|
||||||
print(f"Signal {signum} received and ignored.")
|
|
||||||
shutil.rmtree(dirname)
|
|
||||||
Path.unlink("/tmp/.loguser")
|
|
||||||
print("Process unexpectedly ended...")
|
|
||||||
|
|
||||||
signal.signal(signal.SIGINT, signal_handler)
|
|
||||||
signal.signal(signal.SIGTERM, signal_handler)
|
|
||||||
signal.signal(signal.SIGHUP, signal_handler)
|
|
||||||
|
|
||||||
|
|
||||||
def if_tip(path):
|
|
||||||
"""
|
|
||||||
method that writes in file whether tooltip is displayed or not
|
|
||||||
"""
|
|
||||||
with open(path, "r", encoding="utf-8") as set_f2:
|
|
||||||
lines2 = set_f2.readlines()
|
|
||||||
if "False\n" in lines2:
|
|
||||||
tip = False
|
|
||||||
else:
|
|
||||||
tip = True
|
|
||||||
return tip
|
|
||||||
|
|
||||||
|
|
||||||
class Tooltip:
|
class Tooltip:
|
||||||
|
41
wirepy.py
41
wirepy.py
@ -14,8 +14,7 @@ from pathlib import Path
|
|||||||
from subprocess import check_call
|
from subprocess import check_call
|
||||||
from tkinter import TclError, filedialog, ttk
|
from tkinter import TclError, filedialog, ttk
|
||||||
|
|
||||||
from cls_mth_fc import (Create, GiteaUpdate, Tooltip, Tunnel, if_tip,
|
from cls_mth_fc import (Create, GiteaUpdate, Tooltip, Tunnel, LxTools)
|
||||||
LxTools, msg_window, sigi)
|
|
||||||
|
|
||||||
LxTools.uos()
|
LxTools.uos()
|
||||||
Create.dir_and_files()
|
Create.dir_and_files()
|
||||||
@ -23,15 +22,16 @@ Create.make_dir()
|
|||||||
Create.decrypt()
|
Create.decrypt()
|
||||||
|
|
||||||
tcl_path = Path("/usr/share/TK-Themes")
|
tcl_path = Path("/usr/share/TK-Themes")
|
||||||
wg_set = Path(Path.home() / ".config/wire_py/settings")
|
set_file = Path(Path.home() / ".config/wire_py/settings")
|
||||||
tips = if_tip(wg_set)
|
tips = LxTools.if_tip(set_file)
|
||||||
dirname = Path("/tmp/tlecdcwg/")
|
dirname = Path("/tmp/tlecdcwg/")
|
||||||
|
userfile = Path("/tmp/.loguser")
|
||||||
|
|
||||||
# 1 = 1. Year, 09 = Month of the Year, 2924 = Day and Year of the Year
|
# 1 = 1. Year, 09 = Month of the Year, 2924 = Day and Year of the Year
|
||||||
VERSION = "v. 2.04.1725"
|
VERSION = "v. 2.04.1725"
|
||||||
|
|
||||||
res = GiteaUpdate.api_down(
|
res = GiteaUpdate.api_down(
|
||||||
"https://git.ilunix.de/api/v1/repos/punix/Wire-Py/releases", VERSION
|
"https://git.ilunix.de/api/v1/repos/punix/Wire-Py/releases", VERSION, set_file
|
||||||
)
|
)
|
||||||
|
|
||||||
# Translate
|
# Translate
|
||||||
@ -42,7 +42,7 @@ gettext.bindtextdomain(APP, LOCALE_DIR)
|
|||||||
gettext.textdomain(APP)
|
gettext.textdomain(APP)
|
||||||
_ = gettext.gettext
|
_ = gettext.gettext
|
||||||
|
|
||||||
sigi(dirname)
|
LxTools.sigi(dirname, userfile)
|
||||||
|
|
||||||
|
|
||||||
class Wirepy(tk.Tk):
|
class Wirepy(tk.Tk):
|
||||||
@ -168,7 +168,7 @@ class FrameWidgets(ttk.Frame):
|
|||||||
txt2 = _("Go to Wire-Py git")
|
txt2 = _("Go to Wire-Py git")
|
||||||
com = link_btn
|
com = link_btn
|
||||||
|
|
||||||
msg_window(iw, ii, wt, msg_t, txt2, com)
|
LxTools.msg_window(iw, ii, wt, msg_t, txt2, com)
|
||||||
|
|
||||||
# Frame for Menu
|
# Frame for Menu
|
||||||
self.menu_frame = ttk.Frame(self)
|
self.menu_frame = ttk.Frame(self)
|
||||||
@ -197,8 +197,8 @@ class FrameWidgets(ttk.Frame):
|
|||||||
self.settings.add_checkbutton(
|
self.settings.add_checkbutton(
|
||||||
label=_("Disable Tooltips"), command=tooltip, variable=set_tip
|
label=_("Disable Tooltips"), command=tooltip, variable=set_tip
|
||||||
)
|
)
|
||||||
self.settings.add_command(label=_("Light"), command=lambda: LxTools.theme_change_light(self))
|
self.settings.add_command(label=_("Light"), command=lambda: LxTools.theme_change_light(self, set_file))
|
||||||
self.settings.add_command(label=_("Dark"), command=lambda: LxTools.theme_change_dark(self))
|
self.settings.add_command(label=_("Dark"), command=lambda: LxTools.theme_change_dark(self, set_file))
|
||||||
|
|
||||||
# About BTN Menu / Label
|
# About BTN Menu / Label
|
||||||
self.about_btn = ttk.Button(
|
self.about_btn = ttk.Button(
|
||||||
@ -427,7 +427,7 @@ class FrameWidgets(ttk.Frame):
|
|||||||
ii = r"/usr/share/icons/lx-icons/48/wg_msg.png"
|
ii = r"/usr/share/icons/lx-icons/48/wg_msg.png"
|
||||||
wt = _("Select tunnel")
|
wt = _("Select tunnel")
|
||||||
msg_t = _("Please select a tunnel from the list")
|
msg_t = _("Please select a tunnel from the list")
|
||||||
msg_window(iw, ii, wt, msg_t)
|
LxTools.msg_window(iw, ii, wt, msg_t)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
@ -436,7 +436,7 @@ class FrameWidgets(ttk.Frame):
|
|||||||
ii = r"/usr/share/icons/lx-icons/48/wg_msg.png"
|
ii = r"/usr/share/icons/lx-icons/48/wg_msg.png"
|
||||||
wt = _("Select tunnel")
|
wt = _("Select tunnel")
|
||||||
msg_t = _("Please first import tunnel")
|
msg_t = _("Please first import tunnel")
|
||||||
msg_window(iw, ii, wt, msg_t)
|
LxTools.msg_window(iw, ii, wt, msg_t)
|
||||||
|
|
||||||
# Button Trash
|
# Button Trash
|
||||||
self.btn_tr = ttk.Button(
|
self.btn_tr = ttk.Button(
|
||||||
@ -500,7 +500,7 @@ class FrameWidgets(ttk.Frame):
|
|||||||
ii = r"/usr/share/icons/lx-icons/48/wg_msg.png"
|
ii = r"/usr/share/icons/lx-icons/48/wg_msg.png"
|
||||||
wt = _("Renaming not possible")
|
wt = _("Renaming not possible")
|
||||||
msg_t = _("The new name may contain only 12 characters")
|
msg_t = _("The new name may contain only 12 characters")
|
||||||
msg_window(iw, ii, wt, msg_t)
|
LxTools.msg_window(iw, ii, wt, msg_t)
|
||||||
|
|
||||||
elif len(self.lb_rename.get()) == 0:
|
elif len(self.lb_rename.get()) == 0:
|
||||||
|
|
||||||
@ -509,7 +509,7 @@ class FrameWidgets(ttk.Frame):
|
|||||||
ii = r"/usr/share/icons/lx-icons/48/wg_msg.png"
|
ii = r"/usr/share/icons/lx-icons/48/wg_msg.png"
|
||||||
wt = _("Renaming not possible")
|
wt = _("Renaming not possible")
|
||||||
msg_t = _("At least one character must be entered")
|
msg_t = _("At least one character must be entered")
|
||||||
msg_window(iw, ii, wt, msg_t)
|
LxTools.msg_window(iw, ii, wt, msg_t)
|
||||||
|
|
||||||
elif any(ch in special_characters for ch in self.lb_rename.get()):
|
elif any(ch in special_characters for ch in self.lb_rename.get()):
|
||||||
|
|
||||||
@ -520,7 +520,7 @@ class FrameWidgets(ttk.Frame):
|
|||||||
msg_t = _(
|
msg_t = _(
|
||||||
"No valid sign. These must not be used.\nBlank, Slash, Backslash and { }\n"
|
"No valid sign. These must not be used.\nBlank, Slash, Backslash and { }\n"
|
||||||
)
|
)
|
||||||
msg_window(iw, ii, wt, msg_t)
|
LxTools.msg_window(iw, ii, wt, msg_t)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
@ -572,7 +572,7 @@ class FrameWidgets(ttk.Frame):
|
|||||||
ii = r"/usr/share/icons/lx-icons/48/wg_msg.png"
|
ii = r"/usr/share/icons/lx-icons/48/wg_msg.png"
|
||||||
wt = _("Renaming not possible")
|
wt = _("Renaming not possible")
|
||||||
msg_t = _("Please select a tunnel from the list")
|
msg_t = _("Please select a tunnel from the list")
|
||||||
msg_window(iw, ii, wt, msg_t)
|
LxTools.msg_window(iw, ii, wt, msg_t)
|
||||||
|
|
||||||
# Button Rename
|
# Button Rename
|
||||||
self.btn_rename = ttk.Button(
|
self.btn_rename = ttk.Button(
|
||||||
@ -678,7 +678,7 @@ class FrameWidgets(ttk.Frame):
|
|||||||
msg_t = _(
|
msg_t = _(
|
||||||
"Tunnel already available!\nPlease use another file for import"
|
"Tunnel already available!\nPlease use another file for import"
|
||||||
)
|
)
|
||||||
msg_window(iw, ii, wt, msg_t)
|
LxTools.msg_window(iw, ii, wt, msg_t)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
@ -827,7 +827,7 @@ class FrameWidgets(ttk.Frame):
|
|||||||
msg_t = _(
|
msg_t = _(
|
||||||
"Oh... no valid Wireguard File!\nPlease select a valid Wireguard File"
|
"Oh... no valid Wireguard File!\nPlease select a valid Wireguard File"
|
||||||
)
|
)
|
||||||
msg_window(iw, ii, wt, msg_t)
|
LxTools.msg_window(iw, ii, wt, msg_t)
|
||||||
|
|
||||||
except EOFError as e:
|
except EOFError as e:
|
||||||
print(e)
|
print(e)
|
||||||
@ -1056,7 +1056,7 @@ class FrameWidgets(ttk.Frame):
|
|||||||
ii = r"/usr/share/icons/lx-icons/48/wg_msg.png"
|
ii = r"/usr/share/icons/lx-icons/48/wg_msg.png"
|
||||||
wt = _("Select tunnel")
|
wt = _("Select tunnel")
|
||||||
msg_t = _("Please select a tunnel from the list")
|
msg_t = _("Please select a tunnel from the list")
|
||||||
msg_window(iw, ii, wt, msg_t)
|
LxTools.msg_window(iw, ii, wt, msg_t)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
@ -1065,7 +1065,7 @@ class FrameWidgets(ttk.Frame):
|
|||||||
ii = r"/usr/share/icons/lx-icons/48/wg_msg.png"
|
ii = r"/usr/share/icons/lx-icons/48/wg_msg.png"
|
||||||
wt = _("Select tunnel")
|
wt = _("Select tunnel")
|
||||||
msg_t = _("Please first import tunnel")
|
msg_t = _("Please first import tunnel")
|
||||||
msg_window(iw, ii, wt, msg_t)
|
LxTools.msg_window(iw, ii, wt, msg_t)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
@ -1081,6 +1081,5 @@ if __name__ == "__main__":
|
|||||||
window.tk.call("set", "::tk::dialog::file::showHiddenVar", "0")
|
window.tk.call("set", "::tk::dialog::file::showHiddenVar", "0")
|
||||||
window.mainloop()
|
window.mainloop()
|
||||||
|
|
||||||
shutil.rmtree(dirname)
|
LxTools.clean_files(dirname, userfile)
|
||||||
Path.unlink("/tmp/.loguser")
|
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user