fix set_file and remove wg_set variable
This commit is contained in:
parent
af702f297b
commit
67ff24f0b6
Binary file not shown.
@ -23,8 +23,6 @@ gettext.bindtextdomain(APP, LOCALE_DIR)
|
|||||||
gettext.textdomain(APP)
|
gettext.textdomain(APP)
|
||||||
_ = gettext.gettext
|
_ = gettext.gettext
|
||||||
|
|
||||||
#wg_set = Path(Path.home() / ".config/wire_py/settings")
|
|
||||||
|
|
||||||
|
|
||||||
class Create:
|
class Create:
|
||||||
"""
|
"""
|
||||||
@ -129,12 +127,15 @@ class Create:
|
|||||||
else:
|
else:
|
||||||
print(f"Error with the following code... {process.returncode}")
|
print(f"Error with the following code... {process.returncode}")
|
||||||
|
|
||||||
|
|
||||||
class LxTools(tk.Tk):
|
class LxTools(tk.Tk):
|
||||||
|
"""
|
||||||
|
Class LinuxTools methods that can also be used for other apps
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
def theme_change_light(self, file=None):
|
def theme_change_light(self, file=None):
|
||||||
"""
|
"""
|
||||||
Set light theme
|
Set light theme
|
||||||
@ -148,7 +149,6 @@ class LxTools(tk.Tk):
|
|||||||
theme_set2.writelines(lines3)
|
theme_set2.writelines(lines3)
|
||||||
self.color_label()
|
self.color_label()
|
||||||
|
|
||||||
|
|
||||||
def theme_change_dark(self, file=None):
|
def theme_change_dark(self, file=None):
|
||||||
"""
|
"""
|
||||||
Set dark theme
|
Set dark theme
|
||||||
@ -178,9 +178,15 @@ class LxTools(tk.Tk):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def clean_files(dirname=None, file=None):
|
def clean_files(dirname=None, file=None):
|
||||||
if dirname != None:
|
"""
|
||||||
|
method that can be added after need to delete a folder and a file when quitting.
|
||||||
|
Args:
|
||||||
|
dirname (_folder_, optional): _path to folder_. Defaults to None.
|
||||||
|
file (_file_, optional): _path to file_. Defaults to None.
|
||||||
|
"""
|
||||||
|
if dirname is not None:
|
||||||
shutil.rmtree(dirname)
|
shutil.rmtree(dirname)
|
||||||
if file != None:
|
if file is not None:
|
||||||
Path.unlink(file)
|
Path.unlink(file)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -431,7 +437,7 @@ class Tunnel:
|
|||||||
in the user's home directory with correct right
|
in the user's home directory with correct right
|
||||||
"""
|
"""
|
||||||
now_time = datetime.now()
|
now_time = datetime.now()
|
||||||
now_datetime = now_time.strftime(f"wg-exp-%m-%d-%Y-%H:%M")
|
now_datetime = now_time.strftime("wg-exp-%m-%d-%Y-%H:%M")
|
||||||
tl = Tunnel.list()
|
tl = Tunnel.list()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -473,8 +479,6 @@ class Tunnel:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Tooltip:
|
class Tooltip:
|
||||||
"""
|
"""
|
||||||
class for Tooltip
|
class for Tooltip
|
||||||
|
@ -372,7 +372,7 @@ class FrameWidgets(ttk.Frame):
|
|||||||
pre_key = key[3]
|
pre_key = key[3]
|
||||||
check_call(["nmcli", "connection", "delete", select_tl])
|
check_call(["nmcli", "connection", "delete", select_tl])
|
||||||
self.l_box.delete(self.select_tunnel[0])
|
self.l_box.delete(self.select_tunnel[0])
|
||||||
with open(set_filele, "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()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user