fix install and .desktop File Tar works now for user home and filebrowser.askfilebrowser start now in user home

This commit is contained in:
Désiré Werner Menrath 2024-09-19 22:23:34 +02:00
parent b633fac5a0
commit 3965844b6b
4 changed files with 36 additions and 28 deletions

View File

@ -4,11 +4,11 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="940e1630-c825-4d4c-be80-bc11f543c122" name="Changes" comment="fix a filedialog for hidden Files work&#10;install rollback to bash for start wirepy and wirepy rollback to bash"> <list default="true" id="940e1630-c825-4d4c-be80-bc11f543c122" name="Changes" comment="install rollback bash to py wirepy rollback to py">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/install" beforeDir="false" afterPath="$PROJECT_DIR$/install" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Wire-Py.desktop" beforeDir="false" afterPath="$PROJECT_DIR$/Wire-Py.desktop" afterDir="false" />
<change beforePath="$PROJECT_DIR$/wg_func.py" beforeDir="false" afterPath="$PROJECT_DIR$/wg_func.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/wg_func.py" beforeDir="false" afterPath="$PROJECT_DIR$/wg_func.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/wirepy" beforeDir="false" afterPath="$PROJECT_DIR$/wirepy.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/wirepy.py" beforeDir="false" afterPath="$PROJECT_DIR$/wirepy.py" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -42,23 +42,23 @@
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent"><![CDATA[{ <component name="PropertiesComponent">{
"keyToString": { &quot;keyToString&quot;: {
"ASKED_ADD_EXTERNAL_FILES": "true", &quot;ASKED_ADD_EXTERNAL_FILES&quot;: &quot;true&quot;,
"Python.INSTALL.executor": "Run", &quot;Python.INSTALL.executor&quot;: &quot;Run&quot;,
"Python.install.executor": "Run", &quot;Python.install.executor&quot;: &quot;Run&quot;,
"Python.main.executor": "Run", &quot;Python.main.executor&quot;: &quot;Run&quot;,
"Python.messagebox.executor": "Run", &quot;Python.messagebox.executor&quot;: &quot;Run&quot;,
"Python.start_wg.executor": "Run", &quot;Python.start_wg.executor&quot;: &quot;Run&quot;,
"Python.wg_func.executor": "Run", &quot;Python.wg_func.executor&quot;: &quot;Run&quot;,
"Python.wg_main.executor": "Run", &quot;Python.wg_main.executor&quot;: &quot;Run&quot;,
"RunOnceActivity.ShowReadmeOnStart": "true", &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
"Shell Script.install.executor": "Run", &quot;Shell Script.install.executor&quot;: &quot;Run&quot;,
"git-widget-placeholder": "main", &quot;git-widget-placeholder&quot;: &quot;main&quot;,
"last_opened_file_path": "/home/punix/Pyapps/wire-py", &quot;last_opened_file_path&quot;: &quot;/home/punix/Pyapps/wire-py&quot;,
"settings.editor.selected.configurable": "preferences.fileTypes" &quot;settings.editor.selected.configurable&quot;: &quot;preferences.fileTypes&quot;
} }
}]]></component> }</component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$" /> <recent name="$PROJECT_DIR$" />
@ -439,7 +439,15 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1726764877546</updated> <updated>1726764877546</updated>
</task> </task>
<option name="localTasksCounter" value="39" /> <task id="LOCAL-00039" summary="install rollback bash to py wirepy and wirepy rollback to py">
<option name="closed" value="true" />
<created>1726770649542</created>
<option name="number" value="00039" />
<option name="presentableId" value="LOCAL-00039" />
<option name="project" value="LOCAL" />
<updated>1726770649542</updated>
</task>
<option name="localTasksCounter" value="40" />
<servers /> <servers />
</component> </component>
<component name="UnknownFeatures"> <component name="UnknownFeatures">
@ -480,7 +488,6 @@
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" /> <option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
<MESSAGE value="In FrameWidged Class else Block StrVar, this resorts reference and variable assignment together" />
<MESSAGE value="add method init_and_report and label_empty to Class ShowAddress" /> <MESSAGE value="add method init_and_report and label_empty to Class ShowAddress" />
<MESSAGE value="little fixes in Class Import" /> <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" /> <MESSAGE value="fix label when laat Tunnel delete and fix Tuple error in delete and Start/Stop when listbox empty" />
@ -505,6 +512,7 @@
<MESSAGE value="set rights in install and a .conf a import Tunnel Filedialog Part 1 /home when open" /> <MESSAGE value="set rights in install and a .conf a import Tunnel Filedialog Part 1 /home when open" />
<MESSAGE value="fix set rights in install and a .conf a import Tunnel Filedialog Part 1 /home when open" /> <MESSAGE value="fix set rights in install and a .conf a import Tunnel Filedialog Part 1 /home when open" />
<MESSAGE value="fix a filedialog for hidden Files work&#10;install rollback to bash for start wirepy and wirepy rollback to bash" /> <MESSAGE value="fix a filedialog for hidden Files work&#10;install rollback to bash for start wirepy and wirepy rollback to bash" />
<option name="LAST_COMMIT_MESSAGE" value="fix a filedialog for hidden Files work&#10;install rollback to bash for start wirepy and wirepy rollback to bash" /> <MESSAGE value="install rollback bash to py wirepy and wirepy rollback to py" />
<option name="LAST_COMMIT_MESSAGE" value="install rollback bash to py wirepy and wirepy rollback to py" />
</component> </component>
</project> </project>

View File

@ -1,7 +1,7 @@
[Desktop Entry] [Desktop Entry]
Type=Application Type=Application
Name=Wire-Py Name=Wire-Py
Exec=/usr/bin/wirepy Exec=/usr/bin/wirepy.py
Terminal=false Terminal=false
Categories=Network; Categories=Network;
Icon=/usr/share/icons/wp-icons/128/wg_vpn.png Icon=/usr/share/icons/wp-icons/128/wg_vpn.png

View File

@ -9,7 +9,7 @@ from subprocess import check_call
font_color = '#4011a7' font_color = '#4011a7'
path_to_file = Path('/etc/wire_py/wg_py') path_to_file = Path('/etc/wire_py/wg_py')
_u = Path.read_text(Path('/tmp/_u'))
def msg_window(): def msg_window():
msg = tk.Toplevel() msg = tk.Toplevel()
@ -181,7 +181,7 @@ class ImportTunnel:
def wg_import_select(self): def wg_import_select(self):
try: try:
filepath = filedialog.askopenfilename(initialdir='/home/', title='Select Wireguard config File', 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: with open(filepath, 'r') as file:
@ -293,13 +293,13 @@ class OnOff:
class ExportTunnels: class ExportTunnels:
@staticmethod @staticmethod
def wg_export(): def wg_export():
_u = Path.read_text(Path('/tmp/_u'))
now_time = datetime.now() now_time = datetime.now()
now_datetime = now_time.strftime('wg-exp-' + '%m-%d-%Y' + '-' + '%H:%M') now_datetime = now_time.strftime('wg-exp-' + '%m-%d-%Y' + '-' + '%H:%M')
tl = ListTunnels.tl_list() tl = ListTunnels.tl_list()
try: try:
if len(tl) != 0: if len(tl) != 0:
wg_tar = '/home/' + str(_u) + now_datetime wg_tar = str(_u) + '/' + now_datetime
p_to_conf = Path('/etc/wire_py/') p_to_conf = Path('/etc/wire_py/')
shutil.make_archive(wg_tar, 'zip', p_to_conf) shutil.make_archive(wg_tar, 'zip', p_to_conf)
#if zip_full != 0: #if zip_full != 0:

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/python3
from subprocess import check_call from subprocess import check_call
from pathlib import Path from pathlib import Path