Aufgeräumt
This commit is contained in:
parent
828cc5dbe1
commit
d6e6f01329
2 changed files with 67 additions and 33 deletions
|
|
@ -24,7 +24,7 @@ else:
|
|||
|
||||
log_dir.mkdir(exist_ok=True)
|
||||
|
||||
log_file = log_dir / "categorize_transactions.log"
|
||||
log_file = log_dir / "ing.log"
|
||||
|
||||
logging.basicConfig(
|
||||
filename=log_file,
|
||||
|
|
@ -32,7 +32,9 @@ logging.basicConfig(
|
|||
format="%(asctime)s [%(levelname)s] %(message)s",
|
||||
)
|
||||
|
||||
logging.info("=== Scriptstart ===")
|
||||
logging.info(
|
||||
"[categorize] === Scriptstart ==="
|
||||
)
|
||||
|
||||
# --------------------------------------------------
|
||||
# Kalenderwoche bestimmen
|
||||
|
|
@ -109,7 +111,7 @@ excel_file = (
|
|||
|
||||
if not source_json.exists():
|
||||
logging.error(
|
||||
f"Transaktionsdatei nicht gefunden: {source_json}"
|
||||
f"[categorize] Transaktionsdatei nicht gefunden: {source_json}"
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
|
|
@ -462,10 +464,10 @@ with open(summary_file, "w", encoding="utf-8") as outfile:
|
|||
# Ausgabe
|
||||
# --------------------------------------------------
|
||||
|
||||
logging.info(f"Jahr : {year}")
|
||||
logging.info(f"Kalenderwoche : {week}")
|
||||
logging.info(f"[categorize] Jahr : {year}")
|
||||
logging.info(f"[categorize] Kalenderwoche : {week}")
|
||||
logging.info(
|
||||
f"Transaktionen : {len(categorized_transactions)}"
|
||||
f"[categorize] Transaktionen : {len(categorized_transactions)}"
|
||||
)
|
||||
|
||||
logging.info("----------------------------------------")
|
||||
|
|
@ -474,16 +476,16 @@ logging.info("----------------------------------------")
|
|||
|
||||
for category, values in sorted(category_totals.items()):
|
||||
logging.info(
|
||||
f"Kategorie={category}; "
|
||||
f"Einnahmen={values['income']:.2f}; "
|
||||
f"Ausgaben={values['expenses']:.2f}; "
|
||||
f"Saldo={values['saldo']:.2f}"
|
||||
f"[categorize] Kategorie={category}; "
|
||||
f"[categorize] Einnahmen={values['income']:.2f}; "
|
||||
f"[categorize] Ausgaben={values['expenses']:.2f}; "
|
||||
f"[categorize] Saldo={values['saldo']:.2f}"
|
||||
)
|
||||
|
||||
logging.info(f"CSV : {csv_file}")
|
||||
logging.info(f"JSON : {json_file}")
|
||||
logging.info(f"Summary : {summary_file}")
|
||||
logging.info(f"Excel : {excel_file}")
|
||||
logging.info(f"[categorize] CSV : {csv_file}")
|
||||
logging.info(f"[categorize] JSON : {json_file}")
|
||||
logging.info(f"[categorize] Summary : {summary_file}")
|
||||
logging.info(f"[categorize] Excel : {excel_file}")
|
||||
|
||||
# --------------------------------------------------
|
||||
# Synchronisation
|
||||
|
|
@ -503,11 +505,11 @@ if which("rclone"):
|
|||
check=True
|
||||
)
|
||||
|
||||
logging.info("Excel nach Nextcloud synchronisiert.")
|
||||
logging.info("[categorize] Excel nach Nextcloud synchronisiert.")
|
||||
|
||||
except Exception as e:
|
||||
|
||||
logging.error(f"rclone Fehler: {e}")
|
||||
logging.error(f"[categorize] rclone Fehler: {e}")
|
||||
|
||||
elif platform.system() == "Windows":
|
||||
|
||||
|
|
@ -536,18 +538,20 @@ elif platform.system() == "Windows":
|
|||
)
|
||||
|
||||
logging.info(
|
||||
f"Nextcloud-Synchronisation erfolgreich: {target_file}"
|
||||
f"[categorize] Nextcloud-Synchronisation erfolgreich: {target_file}"
|
||||
)
|
||||
|
||||
except Exception as e:
|
||||
|
||||
logging.error(
|
||||
f"Nextcloud-Kopie fehlgeschlagen: {e}"
|
||||
f"[categorize] Nextcloud-Kopie fehlgeschlagen: {e}"
|
||||
)
|
||||
else:
|
||||
|
||||
logging.warning(
|
||||
"Keine Synchronisationsmethode gefunden."
|
||||
"[categorize] Keine Synchronisationsmethode gefunden."
|
||||
)
|
||||
|
||||
logging.info("=== Scriptende ===")
|
||||
logging.info(
|
||||
"[categorize] === Scriptende ==="
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue