From d025689193e14b6ab8764f28e95506af5569227d Mon Sep 17 00:00:00 2001 From: max Date: Sat, 26 Sep 2026 13:43:01 +0200 Subject: [PATCH] refactor(quality): clean up unused imports, variables, and redundant f-strings --- src/License_Authority.py | 1 - src/Linux_Client.py | 2 +- src/Server.py | 7 +++---- src/Win_Client.py | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/License_Authority.py b/src/License_Authority.py index ee98c2e..36dae79 100644 --- a/src/License_Authority.py +++ b/src/License_Authority.py @@ -6,7 +6,6 @@ Repo: https://gitea.eibl.tech/me0nline/LOGAR-LICENSING.git """ import os -import sys import importlib.util ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) diff --git a/src/Linux_Client.py b/src/Linux_Client.py index f352d99..f5c2466 100644 --- a/src/Linux_Client.py +++ b/src/Linux_Client.py @@ -9,7 +9,7 @@ import subprocess import urllib.request import warnings from datetime import datetime, timezone, timedelta -from typing import Optional, Dict, Any, List +from typing import Optional # Suppress cryptography / pgpy deprecation notices warnings.filterwarnings("ignore") diff --git a/src/Server.py b/src/Server.py index 92e627f..b2cf1cf 100644 --- a/src/Server.py +++ b/src/Server.py @@ -443,7 +443,7 @@ def load_or_init_config(config_path: str = CONFIG_FILE_NAME) -> Dict[str, Any]: with open(config_path, "w", encoding="utf-8") as f: json.dump(config, f, indent=2) - print(f"[+] Successfully generated new server config and OpenPGP keypair.") + print("[+] Successfully generated new server config and OpenPGP keypair.") print(f"[+] Server Encryption Fingerprint: {fingerprint}") print(f"[+] Saved to: {os.path.abspath(config_path)}") return config @@ -1896,7 +1896,6 @@ def serve_webui(request: Request = None): pct = summary["percentage"] bar_color = "#10b981" if pct < 70 else ("#f59e0b" if pct < 90 else "#ef4444") badge_status_cls = "badge-active" if summary["status"] == "ACTIVE" else ("badge-warning" if summary["status"] == "SELF-SIGNED" else "badge-revoked") - total_nodes = summary["active_seats"] + summary["revoked_seats"] detected_host = (request.headers.get("host", "").split(":")[0] if request and request.headers else "") or config.get("tcp_host", "127.0.0.1") if detected_host in ("0.0.0.0", "localhost", ""): @@ -2649,7 +2648,7 @@ def main(): force_renew=True ) - print(f"[+] Successfully imported and activated signed license!") + print("[+] Successfully imported and activated signed license!") print(f" - Granted Seats: {new_seats}") print(f" - License ID: {res.get('license_id') or info.get('license_id')}") print(f" - Expires: {info.get('not_valid_after') or res.get('expires_at') or 'N/A'}") @@ -2722,7 +2721,7 @@ def main(): cert_dir=cert_dir, force_renew=True ) - print(f"[+] License successfully synchronized with master server!") + print("[+] License successfully synchronized with master server!") print(f" - Active Seat Quota: {new_seats}") print(f" - License ID: {info.get('license_id')}") print(f" - Expires: {info.get('not_valid_after')}") diff --git a/src/Win_Client.py b/src/Win_Client.py index 97845b1..119c7ff 100644 --- a/src/Win_Client.py +++ b/src/Win_Client.py @@ -8,7 +8,7 @@ import argparse import urllib.request import warnings from datetime import datetime, timezone, timedelta -from typing import Optional, Dict, Any, List +from typing import Optional # Suppress cryptography / pgpy deprecation notices warnings.filterwarnings("ignore")