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.gettext
|
||||
|
||||
#wg_set = Path(Path.home() / ".config/wire_py/settings")
|
||||
|
||||
|
||||
class Create:
|
||||
"""
|
||||
@ -129,12 +127,15 @@ class Create:
|
||||
else:
|
||||
print(f"Error with the following code... {process.returncode}")
|
||||
|
||||
|
||||
class LxTools(tk.Tk):
|
||||
|
||||
"""
|
||||
Class LinuxTools methods that can also be used for other apps
|
||||
"""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
|
||||
def theme_change_light(self, file=None):
|
||||
"""
|
||||
Set light theme
|
||||
@ -148,7 +149,6 @@ class LxTools(tk.Tk):
|
||||
theme_set2.writelines(lines3)
|
||||
self.color_label()
|
||||
|
||||
|
||||
def theme_change_dark(self, file=None):
|
||||
"""
|
||||
Set dark theme
|
||||
@ -178,9 +178,15 @@ class LxTools(tk.Tk):
|
||||
|
||||
@staticmethod
|
||||
def clean_files(dirname=None, file=None):
|
||||
if dirname != None:
|
||||
shutil.rmtree(dirname)
|
||||
if file != 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)
|
||||
if file is not None:
|
||||
Path.unlink(file)
|
||||
|
||||
@staticmethod
|
||||
@ -431,7 +437,7 @@ class Tunnel:
|
||||
in the user's home directory with correct right
|
||||
"""
|
||||
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()
|
||||
|
||||
try:
|
||||
@ -473,8 +479,6 @@ class Tunnel:
|
||||
pass
|
||||
|
||||
|
||||
|
||||
|
||||
class Tooltip:
|
||||
"""
|
||||
class for Tooltip
|
||||
|
@ -372,7 +372,7 @@ class FrameWidgets(ttk.Frame):
|
||||
pre_key = key[3]
|
||||
check_call(["nmcli", "connection", "delete", select_tl])
|
||||
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()
|
||||
if (
|
||||
select_tl == lines6[7].strip()
|
||||
|
Loading…
x
Reference in New Issue
Block a user