wire-py-reformat-14-08-2024 #9

Merged
punix merged 4 commits from wire-py-reformat-14-08-2024 into main 2024-08-25 20:32:05 +02:00
3 changed files with 18 additions and 8 deletions
Showing only changes of commit 980c5a9010 - Show all commits

View File

@ -4,7 +4,7 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="940e1630-c825-4d4c-be80-bc11f543c122" name="Changes" comment="fix label when laat Tunnel delete and fix Tuple error in delete and Start/Stop when listbox empty">
<list default="true" id="940e1630-c825-4d4c-be80-bc11f543c122" name="Changes" comment="remove a ',' in DNS Name">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/wg_func.py" beforeDir="false" afterPath="$PROJECT_DIR$/wg_func.py" afterDir="false" />
@ -219,7 +219,15 @@
<option name="project" value="LOCAL" />
<updated>1724495688099</updated>
</task>
<option name="localTasksCounter" value="17" />
<task id="LOCAL-00017" summary="remove a ',' in DNS Name">
<option name="closed" value="true" />
<created>1724576599289</created>
<option name="number" value="00017" />
<option name="presentableId" value="LOCAL-00017" />
<option name="project" value="LOCAL" />
<updated>1724576599289</updated>
</task>
<option name="localTasksCounter" value="18" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
@ -262,6 +270,7 @@
<MESSAGE value="add method init_and_report and label_empty to Class ShowAddress" />
<MESSAGE value="little fixes in Class Import" />
<MESSAGE value="fix label when laat Tunnel delete and fix Tuple error in delete and Start/Stop when listbox empty" />
<option name="LAST_COMMIT_MESSAGE" value="fix label when laat Tunnel delete and fix Tuple error in delete and Start/Stop when listbox empty" />
<MESSAGE value="remove a ',' in DNS Name" />
<option name="LAST_COMMIT_MESSAGE" value="remove a ',' in DNS Name" />
</component>
</project>

View File

@ -85,12 +85,12 @@ class FrameWidgets(ttk.Frame):
self.peer.config(font=("Ubuntu", 9))
self.peer.grid(column=0, row=7, sticky="we", padx=130)
# Listbox with Scrollbar
self.scrollbar = tk.Scrollbar(self)
self.scrollbar = ttk.Scrollbar(self)
self.l_box = tk.Listbox(self, fg='#606060', selectmode='single')
self.l_box.config(highlightthickness=0, relief='flat')
self.scrollbar.config(command=self.l_box.yview)
self.l_box.config(font=("Ubuntu", 12, "bold"))
self.l_box.grid(column=1, rowspan=3, row=1, )
self.l_box.grid(column=1, rowspan=3, row=1)
# Tunnel List
self.tl = ListTunnels.tl_list()
for tunnels in self.tl:

View File

@ -1,6 +1,6 @@
# Wireguard functions for Wire-Py
import os
import subprocess
import shutil
from tkinter import filedialog
import tkinter as tk
@ -182,14 +182,15 @@ class ImportTunnel:
pathsplit1 = pathsplit[-1]
if "PrivateKey = " in read and "PublicKey = " in read:
if len(pathsplit1) > 17:
p1 = shutil.copy(filepath, os.environ['HOME'] + '/tester/')
pathsplit = pathsplit1[len(pathsplit1) - 17:]
os.rename(filepath, os.environ['HOME'] + '/tester/' + str(pathsplit))
os.rename(p1, os.environ['HOME'] + '/tester/' + str(pathsplit))
if self.a != '':
os.system('nmcli connection down ' + str(TunnelActiv.active()))
os.system('nmcli connection import type wireguard file ' + os.environ['HOME'] + '/tester/' +
str(pathsplit))
else:
subprocess.call('cp ' + str(filepath) + ' ' + os.environ['HOME'] + '/tester/', shell=True)
shutil.copy(filepath, os.environ['HOME'] + '/tester/')
if self.a != '':
os.system('nmcli connection down ' + str(TunnelActiv.active()))
os.system('nmcli connection import type wireguard file ' + str(filepath))