bug fix in rename
This commit is contained in:
parent
08bef8fe6e
commit
c10667ec21
12
wirepy.py
12
wirepy.py
@ -427,7 +427,7 @@ class FrameWidgets(ttk.Frame):
|
|||||||
if is_encrypt.is_file():
|
if is_encrypt.is_file():
|
||||||
Path.unlink(f"{Path.home()}/.config/wire_py/{select_tl}.dat")
|
Path.unlink(f"{Path.home()}/.config/wire_py/{select_tl}.dat")
|
||||||
Path.unlink(f"/tmp/tlecdcwg/{select_tl}.conf")
|
Path.unlink(f"/tmp/tlecdcwg/{select_tl}.conf")
|
||||||
with open(keys, "r", encoding="utf-8") as readfile:
|
with open(AppConfig.KEYS_FILE, "r", encoding="utf-8") as readfile:
|
||||||
with open(f"{Path.home()}/.config/wire_py/keys2", "w", encoding="utf-8") as writefile:
|
with open(f"{Path.home()}/.config/wire_py/keys2", "w", encoding="utf-8") as writefile:
|
||||||
for line in readfile:
|
for line in readfile:
|
||||||
if pre_key not in line.strip("\n"):
|
if pre_key not in line.strip("\n"):
|
||||||
@ -502,9 +502,7 @@ class FrameWidgets(ttk.Frame):
|
|||||||
self.l_box.update()
|
self.l_box.update()
|
||||||
new_a_connect = self.lb_rename.get()
|
new_a_connect = self.lb_rename.get()
|
||||||
self.lb_rename.delete(0, tk.END)
|
self.lb_rename.delete(0, tk.END)
|
||||||
if self.a != "" and self.a == select_tl:
|
|
||||||
self.a = Tunnel.active()
|
|
||||||
self.str_var.set(value=self.a)
|
|
||||||
with open(AppConfig.SETTINGS_FILE, "r", encoding="utf-8") as set_f5:
|
with open(AppConfig.SETTINGS_FILE, "r", encoding="utf-8") as set_f5:
|
||||||
lines5 = set_f5.readlines()
|
lines5 = set_f5.readlines()
|
||||||
if select_tl == lines5[7].strip() and "off\n" not in lines5[7].strip():
|
if select_tl == lines5[7].strip() and "off\n" not in lines5[7].strip():
|
||||||
@ -512,7 +510,7 @@ class FrameWidgets(ttk.Frame):
|
|||||||
with open(AppConfig.SETTINGS_FILE, "w", encoding="utf-8") as theme_set5:
|
with open(AppConfig.SETTINGS_FILE, "w", encoding="utf-8") as theme_set5:
|
||||||
theme_set5.writelines(lines5)
|
theme_set5.writelines(lines5)
|
||||||
self.autoconnect_var.set(value=new_a_connect)
|
self.autoconnect_var.set(value=new_a_connect)
|
||||||
|
self.update_connection_display()
|
||||||
Create.encrypt()
|
Create.encrypt()
|
||||||
|
|
||||||
except IndexError:
|
except IndexError:
|
||||||
@ -542,7 +540,7 @@ class FrameWidgets(ttk.Frame):
|
|||||||
key = Tunnel.con_to_dict(file)
|
key = Tunnel.con_to_dict(file)
|
||||||
pre_key = key[3]
|
pre_key = key[3]
|
||||||
if len(pre_key) != 0:
|
if len(pre_key) != 0:
|
||||||
p_key = keys.read_text(encoding="utf-8")
|
p_key = AppConfig.KEYS_FILE.read_text(encoding="utf-8")
|
||||||
if pre_key in p_key or f"{pre_key}\n" in p_key:
|
if pre_key in p_key or f"{pre_key}\n" in p_key:
|
||||||
|
|
||||||
msg_t = _("Tunnel already available!\nPlease use another file for import")
|
msg_t = _("Tunnel already available!\nPlease use another file for import")
|
||||||
@ -550,7 +548,7 @@ class FrameWidgets(ttk.Frame):
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
with open(keys, "a", encoding="utf-8") as keyfile:
|
with open(AppConfig.KEYS_FILE, "a", encoding="utf-8") as keyfile:
|
||||||
keyfile.write(f"{pre_key}\r")
|
keyfile.write(f"{pre_key}\r")
|
||||||
if len(path_split1) > 17:
|
if len(path_split1) > 17:
|
||||||
p1 = shutil.copy(filepath, "/tmp/tlecdcwg/")
|
p1 = shutil.copy(filepath, "/tmp/tlecdcwg/")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user