rows reformat

This commit is contained in:
Désiré Werner Menrath 2025-04-23 14:29:47 +02:00
parent 3bab0710a4
commit c43c12f961
4 changed files with 42 additions and 45 deletions

2
.idea/misc.xml generated
View File

@ -3,5 +3,5 @@
<component name="Black">
<option name="sdkName" value="Python 3.12 (wire-py)" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.12 (wire-py)" project-jdk-type="Python SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.12" project-jdk-type="Python SDK" />
</project>

2
.idea/wire-py.iml generated
View File

@ -4,7 +4,7 @@
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.venv" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="jdk" jdkName="Python 3.12" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

44
.idea/workspace.xml generated
View File

@ -5,8 +5,7 @@
</component>
<component name="ChangeListManager">
<list default="true" id="940e1630-c825-4d4c-be80-bc11f543c122" name="Changes" comment=" - Update Translate Files">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cls_mth_fc.py" beforeDir="false" afterPath="$PROJECT_DIR$/cls_mth_fc.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/wirepy.py" beforeDir="false" afterPath="$PROJECT_DIR$/wirepy.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -37,32 +36,33 @@
&quot;associatedIndex&quot;: 3
}</component>
<component name="ProjectId" id="2kSbZdjOvr0wsVJSNcaMwSfVaxR" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true">
<component name="ProjectLevelVcsManager">
<ConfirmationsSetting value="2" id="Add" />
</component>
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;ASKED_ADD_EXTERNAL_FILES&quot;: &quot;true&quot;,
&quot;Python.INSTALL.executor&quot;: &quot;Run&quot;,
&quot;Python.install.executor&quot;: &quot;Run&quot;,
&quot;Python.main.executor&quot;: &quot;Run&quot;,
&quot;Python.messagebox.executor&quot;: &quot;Run&quot;,
&quot;Python.start_wg.executor&quot;: &quot;Run&quot;,
&quot;Python.testtheme.executor&quot;: &quot;Run&quot;,
&quot;Python.wg_func.executor&quot;: &quot;Run&quot;,
&quot;Python.wg_main.executor&quot;: &quot;Run&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;Shell Script.install.executor&quot;: &quot;Run&quot;,
&quot;Shell Script.run_as.executor&quot;: &quot;Run&quot;,
&quot;git-widget-placeholder&quot;: &quot;1.11.1024&quot;,
&quot;last_opened_file_path&quot;: &quot;/home/punix/Pyapps/wire-py&quot;,
&quot;settings.editor.selected.configurable&quot;: &quot;reference.settingsdialog.IDE.editor.colors&quot;
<component name="PropertiesComponent"><![CDATA[{
"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",
"RunOnceActivity.git.unshallow": "true",
"Shell Script.install.executor": "Run",
"Shell Script.run_as.executor": "Run",
"git-widget-placeholder": "21-04-2025-new-tooltip",
"last_opened_file_path": "/home/punix/Pyapps/wire-py",
"settings.editor.selected.configurable": "reference.settingsdialog.IDE.editor.colors"
}
}</component>
}]]></component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/lx-icons" />
@ -129,7 +129,7 @@
<component name="SharedIndexes">
<attachedChunks>
<set>
<option value="bundled-python-sdk-8336bb23522e-31b6be0877a2-com.jetbrains.pycharm.community.sharedIndexes.bundled-PC-241.19072.16" />
<option value="bundled-python-sdk-348a24fa61fa-5312c7369657-com.jetbrains.pycharm.community.sharedIndexes.bundled-PC-251.23774.444" />
</set>
</attachedChunks>
</component>

View File

@ -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)