Added Logger + Fixed Code + README and README_IT

This commit is contained in:
2026-03-14 10:53:52 +00:00
parent 0877e07e76
commit 83a65ab26e
10 changed files with 786 additions and 119 deletions

View File

@@ -1,9 +1,10 @@
# constants.py
# constants.py (modificato)
from init import *
import socket
import json
from datetime import date, datetime
import os
from pathlib import Path
LISTFILE = os.path.join(ROOT_DIR_APP, "dir_backups.json")
CONF_FILE = os.path.join(ROOT_DIR_APP, "config.json")
@@ -13,11 +14,17 @@ DATETODAY = date.today()
TIMENOW = datetime.now().strftime("%H:%M:%S")
TIMEDATA = '[ ' + str(DATETODAY) + ' - ' + str(TIMENOW) + ' ]'
with open(LISTFILE, "r") as listfile:
JSON_LIST = json.load(listfile)
# safer load
try:
with open(LISTFILE, "r") as listfile:
JSON_LIST = json.load(listfile)
except Exception:
JSON_LIST = []
with open(CONF_FILE, "r") as conf_file:
JSON_CONF = json.load(conf_file)
print(TIMEDATA)
try:
with open(CONF_FILE, "r") as conf_file:
JSON_CONF = json.load(conf_file)
except Exception:
JSON_CONF = {}
# removed print(TIMEDATA) at module import time