From 82a7e6b96806bc15057fb86a10a2d0aedc7c319e Mon Sep 17 00:00:00 2001 From: "Max P." Date: Mon, 24 Mar 2025 14:16:31 +0100 Subject: [PATCH] Refactors configuration loading to use shared module Replaces inline configuration loading logic with an import from a shared `configuration` module to improve code reuse and maintainability. --- voice_to_text_tray.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/voice_to_text_tray.py b/voice_to_text_tray.py index e50fc11..77d720d 100755 --- a/voice_to_text_tray.py +++ b/voice_to_text_tray.py @@ -9,13 +9,7 @@ import requests from PyQt5.QtWidgets import QApplication, QSystemTrayIcon, QMenu, QAction from PyQt5.QtGui import QIcon from PyQt5.QtCore import QThread, pyqtSignal - -# === Config === -def read_configurations(): - script_dir = os.path.dirname(os.path.abspath(__file__)) - settings_path = os.path.join(script_dir, "pyvtt.settings.json") - with open(settings_path) as f: - return json.load(f) +from configuration import read_configurations CONFIGURATION = read_configurations() CURRENT_PRESET = CONFIGURATION["presets"][0] # Default to first preset