From 8771be760dc121914e4ad48a848da223d2844130 Mon Sep 17 00:00:00 2001 From: punix Date: Mon, 3 Mar 2025 18:27:49 +0100 Subject: [PATCH] Fixes a new user files create --- Changelog | 6 ++++++ cls_mth_fc.py | 13 +++++-------- wg_main.py | 6 ++++-- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Changelog b/Changelog index 443a545..8323ba4 100644 --- a/Changelog +++ b/Changelog @@ -8,6 +8,12 @@ My standard System: Linux Mint 22 Cinnamon - for loops with lists replaced by List Comprehensions - Crypt and Decrypt Config Files in ~/.config/wire_py + ### Added +03-03-2025 + + - Fixes a new user files create + + ### Added 02-03-2025 diff --git a/cls_mth_fc.py b/cls_mth_fc.py index 3244eb4..4289f85 100755 --- a/cls_mth_fc.py +++ b/cls_mth_fc.py @@ -20,6 +20,8 @@ gettext.bindtextdomain(APP, LOCALE_DIR) gettext.textdomain(APP) _ = gettext.gettext +wg_set = Path(Path.home() / '.config/wire_py/settings') + def dirs_and_files(): pth = Path.home() / '.config/wire_py' @@ -32,7 +34,7 @@ def dirs_and_files(): else: sett.touch() - sett.write_text('[UPDATES]\non\n[THEME]\nlight\n[TOOLTIP]\nTrue\n[AUTOSTART ON]\noff') + sett.write_text('[UPDATES]\non\n[THEME]\nlight\n[TOOLTIP]\nTrue\n[AUTOSTART ON]\noff\n') if ks.exists(): pass @@ -51,10 +53,8 @@ def files_for_autostart(): else: wg_ser.touch() - sett.write_text('[Unit]\nDescription=Automatic Tunnel Start\nAfter=network-online.target\n\n[Service]\nType=oneshot\nExecStartPre=/bin/sleep 5\nExecStart=/usr/local/bin/start_wg.py\n[Install]\nWantedBy=default.target') - check_call(['systemctl', '--user', 'enable', wg_start.service]) - -wg_set = Path(Path.home() / '.config/wire_py/settings') + wg_ser.write_text('[Unit]\nDescription=Automatic Tunnel Start\nAfter=network-online.target\n\n[Service]\nType=oneshot\nExecStartPre=/bin/sleep 5\nExecStart=/usr/local/bin/start_wg.py\n[Install]\nWantedBy=default.target') + check_call(['systemctl', '--user', 'enable', 'wg_start.service']) class GiteaUpdate: @@ -303,6 +303,3 @@ class Tipi: return False else: return True - - -wg_tips = Tipi.if_tip(wg_set) diff --git a/wg_main.py b/wg_main.py index f08a7fe..88f0b97 100755 --- a/wg_main.py +++ b/wg_main.py @@ -10,12 +10,14 @@ import tkinter as tk from pathlib import Path from subprocess import check_call from tkinter import filedialog, ttk, TclError -from cls_mth_fc import (Tunnel, msg_window, GiteaUpdate, wg_tips, dirs_and_files, wg_set, files_for_autostart) +from cls_mth_fc import (Tunnel, dirs_and_files, msg_window, Tipi, GiteaUpdate ,files_for_autostart) tcl_path = Path('/usr/share/TK-Themes') +wg_set = Path(Path.home() / '.config/wire_py/settings') +wg_tips = Tipi.if_tip(wg_set) ''' 1 = 1. Year, 09 = Month of the Year, 2924 = Day and Year of the Year ''' -version = 'v. 2.02.2425' +version = 'v. 2.03.0325' res = GiteaUpdate.api_down('https://git.ilunix.de/api/v1/repos/punix/Wire-Py/releases', version)