corectly updated

This commit is contained in:
2025-05-14 14:23:39 +03:00
parent 633c7f9e4c
commit 4a47775a9b
11 changed files with 88 additions and 3578 deletions

View File

@@ -8,9 +8,19 @@ CONFIG_FILE = './Resurse/app_config.txt'
def load_config():
"""Load configuration from app_config.txt."""
if os.path.exists(CONFIG_FILE):
with open(CONFIG_FILE, 'r') as file:
Logger.info("python_functions: Configuration file loaded successfully.")
return json.load(file)
try:
with open(CONFIG_FILE, 'r') as file:
Logger.info("python_functions: Configuration file loaded successfully.")
return json.load(file)
except json.JSONDecodeError as e:
Logger.error(f"python_functions: Failed to parse configuration file. Error: {e}")
return {
"screen_orientation": "Landscape",
"screen_name": "",
"quickconnect_key": "",
"server_ip": "",
"port": ""
}
else:
Logger.error(f"python_functions: Configuration file {CONFIG_FILE} not found.")
return {
@@ -18,7 +28,7 @@ def load_config():
"screen_name": "",
"quickconnect_key": "",
"server_ip": "",
"port": ""
"port": ""
}
# Load configuration and initialize variables