From c43c12f9613642d2ea517d4f8b9d2814372bb234 Mon Sep 17 00:00:00 2001 From: punix Date: Wed, 23 Apr 2025 14:29:47 +0200 Subject: [PATCH] rows reformat --- .idea/misc.xml | 2 +- .idea/wire-py.iml | 2 +- .idea/workspace.xml | 44 ++++++++++++++++++++++---------------------- wirepy.py | 39 ++++++++++++++++++--------------------- 4 files changed, 42 insertions(+), 45 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index d5e9910..3663950 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,5 @@ - + \ No newline at end of file diff --git a/.idea/wire-py.iml b/.idea/wire-py.iml index 2c80e12..6cb8b9a 100644 --- a/.idea/wire-py.iml +++ b/.idea/wire-py.iml @@ -4,7 +4,7 @@ - + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 5c6d238..3a30f82 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,8 +5,7 @@ - - + - + - { - "keyToString": { - "ASKED_ADD_EXTERNAL_FILES": "true", - "Python.INSTALL.executor": "Run", - "Python.install.executor": "Run", - "Python.main.executor": "Run", - "Python.messagebox.executor": "Run", - "Python.start_wg.executor": "Run", - "Python.testtheme.executor": "Run", - "Python.wg_func.executor": "Run", - "Python.wg_main.executor": "Run", - "RunOnceActivity.ShowReadmeOnStart": "true", - "Shell Script.install.executor": "Run", - "Shell Script.run_as.executor": "Run", - "git-widget-placeholder": "1.11.1024", - "last_opened_file_path": "/home/punix/Pyapps/wire-py", - "settings.editor.selected.configurable": "reference.settingsdialog.IDE.editor.colors" + +}]]> @@ -129,7 +129,7 @@ - diff --git a/wirepy.py b/wirepy.py index d1a7074..16f8b67 100755 --- a/wirepy.py +++ b/wirepy.py @@ -156,7 +156,6 @@ class FrameWidgets(ttk.Frame): Set light theme """ if self.tk.call("ttk::style", "theme", "use") == "water-dark": - self.tk.call("set_theme", "light") with open(wg_set, "r", encoding="utf-8") as theme_set2: lines3 = theme_set2.readlines() @@ -170,7 +169,6 @@ class FrameWidgets(ttk.Frame): Set dark theme """ if not self.tk.call("ttk::style", "theme", "use") == "water-dark": - self.tk.call("set_theme", "dark") with open(wg_set, "r", encoding="utf-8") as theme_set2: lines4 = theme_set2.readlines() @@ -303,8 +301,8 @@ class FrameWidgets(ttk.Frame): # Bottom Frame 4 self.lb_frame3 = ttk.Frame(self) self.lb_frame3.configure(relief="flat") - self.lb_frame3.grid(column=0, row=5, columnspan=4, sticky="snew", - padx=2, pady=2) + self.lb_frame3.grid(column=0, row=5, columnspan=4, sticky="snew", + padx=2, pady=2) # Bottom Frame 5 self.lb_frame4 = ttk.Frame(self) @@ -382,7 +380,7 @@ class FrameWidgets(ttk.Frame): # Button Import self.btn_i = ttk.Button(self.lb_frame_btn_lbox, image=self.imp_pic, - command=self.import_sl, padding=0) + command=self.import_sl, padding=0) self.btn_i.grid(column=0, row=1, padx=15, pady=8) Tooltip(self.btn_i, _("Click to import a Wireguard Tunnel"), tips) @@ -395,7 +393,7 @@ class FrameWidgets(ttk.Frame): self.select_tunnel = self.l_box.curselection() select_tl = self.l_box.get(self.select_tunnel[0]) with open(f"/tmp/tlecdcwg/{select_tl}.conf", "r+", encoding="utf-8" - ) as file2: + ) as file2: key = Tunnel.con_to_dict(file2) pre_key = key[3] check_call(["nmcli", "connection", "delete", select_tl]) @@ -403,8 +401,8 @@ class FrameWidgets(ttk.Frame): with open(wg_set, "r", encoding="utf-8") as set_file6: lines6 = set_file6.readlines() if ( - select_tl == lines6[7].strip() - and "off\n" not in lines6[7].strip() + select_tl == lines6[7].strip() + and "off\n" not in lines6[7].strip() ): lines6[7] = "off\n" with open(wg_set, "w", encoding="utf-8") as set_file7: @@ -430,12 +428,12 @@ class FrameWidgets(ttk.Frame): self.wg_autostart.configure(state="disabled") self.lb_rename.configure(state="disabled") Tooltip(self.wg_autostart, _("You must have at least one\ntunnel", - "in the list,to use the autostart"), tips) + "in the list,to use the autostart"), tips) Tooltip(self.btn_exp, _("No Tunnels in List for Export"), tips) Tooltip(self.btn_stst, _("No tunnels to start in the list"), tips) Tooltip(self.lb_rename, _("To rename a tunnel, at least one must", - "be in the list"), tips,) + "be in the list"), tips, ) self.lb_rename.insert(0, _("Max. 12 characters!")) if self.a != "" and self.a == select_tl: @@ -482,8 +480,8 @@ class FrameWidgets(ttk.Frame): Tooltip(self.btn_tr, _("No tunnels to delete in the list"), tips) else: Tooltip(self.btn_tr, _("Click to delete a Wireguard Tunnel\nSelect from the list!"), - tips, - ) + tips, + ) # Button Export self.btn_exp = ttk.Button( @@ -585,8 +583,8 @@ class FrameWidgets(ttk.Frame): with open(wg_set, "r", encoding="utf-8") as set_file5: lines5 = set_file5.readlines() if ( - select_tl == lines5[7].strip() - and "off\n" not in lines5[7].strip() + select_tl == lines5[7].strip() + and "off\n" not in lines5[7].strip() ): lines5[7] = new_a_connect with open(wg_set, "w", encoding="utf-8") as theme_set5: @@ -635,7 +633,6 @@ class FrameWidgets(ttk.Frame): self.wg_autostart.grid(column=0, row=0, pady=15, padx=15, sticky="nw") if self.l_box.size() >= 1 and len(self.l_box.curselection()) >= 1: - Tooltip( self.wg_autostart, _("To use the autostart, enable this Checkbox"), tips ) @@ -690,9 +687,9 @@ class FrameWidgets(ttk.Frame): self.a = Tunnel.active() if ( - "PrivateKey = " in read - and "PublicKey = " in read - and "Endpoint =" in read + "PrivateKey = " in read + and "PublicKey = " in read + and "Endpoint =" in read ): with open(filepath, "r", encoding="utf-8") as file: key = Tunnel.con_to_dict(file) @@ -718,8 +715,8 @@ class FrameWidgets(ttk.Frame): if len(path_split1) > 17: p1 = shutil.copy(filepath, "/tmp/tlecdcwg/") path_split = path_split1[ - len(path_split1) - 17 : - ] + len(path_split1) - 17: + ] os.rename( p1, f"/tmp/tlecdcwg/{path_split}" ) @@ -828,7 +825,7 @@ class FrameWidgets(ttk.Frame): self.stop() wg_read = f"/tmp/tlecdcwg/{self.a}.conf" with open( - wg_read, "r", encoding="utf-8" + wg_read, "r", encoding="utf-8" ) as file_for_key: data = Tunnel.con_to_dict(file_for_key)