diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 65b4c32..08b14b8 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,11 +4,9 @@
-
+
-
-
@@ -447,7 +445,15 @@
1726770649542
-
+
+
+ 1726777434040
+
+
+
+ 1726777434040
+
+
@@ -488,7 +494,6 @@
-
@@ -513,6 +518,7 @@
-
+
+
\ No newline at end of file
diff --git a/wg_func.py b/wg_func.py
index 1d6e700..eb341bf 100755
--- a/wg_func.py
+++ b/wg_func.py
@@ -1,8 +1,9 @@
# Wireguard functions for Wire-Py
import os
import shutil
+import zipfile
from datetime import datetime
-from tkinter import filedialog
+from tkinter import filedialog, messagebox
import tkinter as tk
from pathlib import Path
from subprocess import check_call
@@ -11,6 +12,7 @@ font_color = '#4011a7'
path_to_file = Path('/etc/wire_py/wg_py')
_u = Path.read_text(Path('/tmp/_u'))
+
def msg_window():
msg = tk.Toplevel()
msg.resizable(width=False, height=False)
@@ -182,7 +184,7 @@ class ImportTunnel:
def wg_import_select(self):
try:
filepath = filedialog.askopenfilename(initialdir=str(_u), title='Select Wireguard config File',
- filetypes=[('WG config files', '*.conf')],)
+ filetypes=[('WG config files', '*.conf')], )
with open(filepath, 'r') as file:
read = file.read()
@@ -302,11 +304,11 @@ class ExportTunnels:
wg_tar = str(_u) + '/' + now_datetime
p_to_conf = Path('/etc/wire_py/')
shutil.make_archive(wg_tar, 'zip', p_to_conf)
- #if zip_full != 0:
- #print('Export erfolgraeich')
- #else:
- #print('ups etwwas ging schief bitte Export wiederholen')
- else:
- print('No Tunnel for Export')
+ with zipfile.ZipFile((wg_tar + '.zip'), 'r') as zf:
+ if len(zf.namelist()) != 0:
+ messagebox.showinfo('Wire_py Export', 'Tarfile is in your Homedirectory')
+ else:
+ messagebox.showerror('Wire_py Export', 'Tarfile is failed please resume Export')
except TypeError:
pass
+