Răsfoiți Sursa

Command "info" hinzugefügt

gc-server3 1 săptămână în urmă
părinte
comite
c0082f4cf7
3 a modificat fișierele cu 74 adăugiri și 5 ștergeri
  1. 6 5
      data/clients.csv
  2. 38 0
      info.py
  3. 30 0
      main.py

+ 6 - 5
data/clients.csv

@@ -179,15 +179,15 @@ GAPS (global-cube);Hedtke alt C11 HS/P2 WS16 (global-cube#7);2025-11-06T16:15:39
 gcadm (1120GlobalCube);Vogl C11 ARI WS19;2026-07-20T14:40:43;Vogl C11
 gcube (TPDE121311);Elmer  C7 Optima WS12;2023-12-11T14:39:01;Elmer  C7
 global (SMMMIS01);Reisacher C7 Navision WS12 (SMMMIS01#2);2026-03-12T16:31:44;Reisacher C7
-global (SMMMIS02);Reisacher C11 NAVISION/ARI WS22 (SMMMIS02#7);2026-08-12T09:30:42;Reisacher C11
+global (SMMMIS02);Reisacher C11 NAVISION/ARI WS22 (SMMMIS02#7);2026-08-21T19:32:58;Reisacher C11
 Global (TOSCON1);Timmermanns C7/C11 Navision/ARI WS19 (TOSCON1);2026-07-06T11:37:32;Timmermanns C7
 Global Cube (2322GlobalCube);Weis C11 LOCOSOFT WS19 (2322GlobalCube#5);2024-03-06T18:31:05;Weis C11
-Global Cube (AB-GlobalCube);Bichmann C11 OPTIMA_SKR51 WS22;2026-07-06T12:02:44;Bichmann C11
+Global Cube (AB-GlobalCube);Bichmann C11 OPTIMA_SKR51 WS22;2026-08-19T17:20:31;Bichmann C11
 Global Cube (ABA-SRV-APP01);Bieling C11 LOCOSOFT WS22;2026-07-06T12:04:37;Bieling C11
 Global Cube (AHK-CUBE);Kleinemeier C11 WERWISO Win10 (AHK-CUBE);2024-03-11T10:37:51;Kleinemeier C11
 Global Cube (AHRAAP03);gekündigt - Rastetter WERWISO/DATEV WS19 (AHRAAP03#1);2025-01-14T20:46:51;gekuendigt - Rastetter WERWISO_DATEV WS19 (AHRAAP03#1)
 Global Cube (AHT-S-GCBS-01);Tabor C11 OPTIMA WS19;2024-08-19T10:40:53;Tabor C11
-Global Cube (AMD-GCube-01);Darmas /Tiemeyer C11 CARLO/LOCOSOFT/SAP WS22 (AMD-GCube-01);2026-07-06T10:03:55;Darmas _Tiemeyer C11
+Global Cube (AMD-GCube-01);Darmas /Tiemeyer C11 CARLO/LOCOSOFT/SAP WS22 (AMD-GCube-01);2026-08-19T16:34:39;Darmas _Tiemeyer C11
 Global Cube (APP039);Brass/Jacob C11 OPTIMA WS25;2026-03-26T12:25:34;Brass_Jacob C11
 Global Cube (ASHKSCUBE01);Schmid C11 LOCOSOFT WS19 (ASHKSCUBE01);2026-07-15T11:33:08;Schmid C11
 Global Cube (berkem-bi-01);Berkemeier Münster C11 DATEV/ATTRIBUT/(CARLO) WS25;2026-07-06T09:59:22;Berkemeier Muenster C11
@@ -221,6 +221,7 @@ Global Cube (RUO-GlobalCube);Reichstein & Opitz C11 OPTIMA WS19 (RUO-GlobalCube)
 Global Cube (SGBIWH01);Hasler C11 AUTOLINE WS22;2026-02-09T08:36:49;Hasler C11
 Global Cube (shcgc01);Heinen Dortmund C11 LOCOSOFT WS22 heinen-nrw.de;2026-07-20T16:02:16;Heinen Dortmund C11
 Global Cube (sievers-group);sievers-group C11 Win10 (Testumgebung);2023-09-14T10:36:08;sievers-group C11
+Global Cube (SNDGAPS);Nefzger C11 ARI/NAVISION WS19 (SNDGAPS);2026-08-20T13:20:39;Nefzger C11
 Global Cube (SRV-APP4);Müller Freising C11 WERWISO/DATEV WS16 ahm.gmbh;2026-07-06T10:06:42;Mueller Freising C11
 Global Cube (SrvGC01);Greiner C11 LOCOSOFT WS22 (SrvGC01);2026-07-15T08:43:14;Greiner C11
 Global Cube (Station55);Gerds C11 CARLO Win10;2026-07-15T08:37:23;Gerds C11
@@ -235,7 +236,7 @@ Global1 (VPN_DK);VM Toni (VPN-DK, Van Eupen, Winter, Elspass, Schneider-Gruppe);
 Globalcube (APP01);Förster C7 Autosys WS12 (APP01#9);2024-05-29T15:13:35;Foerster C7
 globalcube (azebber-bi);Ebber C7 Audev WS16 (azebber-bi);2024-05-31T10:22:21;Ebber C7
 globalcube (berkem-bi-01);Berkemeier Münster C11 DATEV/ATTRIBUT/(CARLO) WS25;2026-04-26T15:45:49;Berkemeier Muenster C11
-globalcube (C00046);Becker-Tiemann Bielefeld C11 ARI WS19;2026-07-24T11:19:07;Becker-Tiemann Bielefeld C11
+globalcube (C00046);Becker-Tiemann Bielefeld C11 ARI WS19;2026-08-20T11:06:57;Becker-Tiemann Bielefeld C11
 globalcube (CS-S-GC);Croll & Sondermann  C7 Optima Win10 (CS-S-GC);2024-02-20T15:32:40;Croll u. Sondermann  C7
 GlobalCube (DE0017GQ);Boettche C7 Carlo WS08 (DE0017GQ);2023-11-24T10:47:05;Boettche C7
 GlobalCube (global-cube4);Lausse C11 OPTIMA Win10;2024-03-06T16:05:31;Lausse C11
@@ -248,7 +249,7 @@ globalcube (HS-55552);K
 Globalcube (S-Cube);von der Weppen C11 WERWISO WS16 (S-Cube);2023-11-13T18:25:56;von der Weppen C11
 gocuadmin (DE0509-GAPS);Siebrecht C7 Optima WS16 (DE0509-GAPS#2);2026-07-16T08:34:25;Siebrecht C7
 Matthias Winter;Reisacher C7 Navision WS12 (SMMMIS01#2);2022-06-30T14:10:20;Reisacher C7
-MISadm (lax-mis);Automag C11 ARI WS19 (lax-mis);2026-08-19T09:58:20;Automag C11
+MISadm (lax-mis);Automag C11 ARI WS19 (lax-mis);2026-08-20T11:15:13;Automag C11
 nzw (GlobalCube);Loeffler C11 LOCOSOFT Win10 NUC;2023-11-23T11:03:37;Loeffler C11
 Psotka (YLTH714162);Psotka C7 Optima Win10 (YLTH714162#3);2026-07-16T08:06:33;Psotka C7
 Stat50 (Station50);Dresen C7 Optima WS19(GAPSDE444441);2025-08-20T15:53:51;Dresen C7

+ 38 - 0
info.py

@@ -0,0 +1,38 @@
+from dataclasses import dataclass
+from pathlib import Path
+
+from archive_logs import ArchiveLogsResult
+from archive_logs import run as run_archive_logs
+from clients import ClientsResult
+from clients import run as run_clients
+from session_details import SessionDetailsResult
+from session_details import run as run_session_details
+from summary import SummaryResult
+from summary import run as run_summary
+
+
+@dataclass(frozen=True)
+class InfoResult:
+    clients_result: ClientsResult
+    archive_result: ArchiveLogsResult
+    session_details_result: SessionDetailsResult
+    summary_result: SummaryResult
+
+
+def run(
+    directory: Path,
+    clients_output: Path,
+    session_details_output: Path,
+    summary_output: Path,
+    days: int = 14,
+) -> InfoResult:
+    clients_result = run_clients(directory, clients_output)
+    archive_result = run_archive_logs(directory)
+    session_details_result = run_session_details(directory, session_details_output)
+    summary_result = run_summary(session_details_output, summary_output, days)
+    return InfoResult(
+        clients_result=clients_result,
+        archive_result=archive_result,
+        session_details_result=session_details_result,
+        summary_result=summary_result,
+    )

+ 30 - 0
main.py

@@ -6,6 +6,7 @@ import typer
 from archive_logs import run as run_archive_logs
 from clients import run
 from files import run as run_files
+from info import run as run_info
 from move_files import default_desktop, refresh_and_move
 from session_details import run as run_session_details
 from summary import run as run_summary
@@ -133,6 +134,35 @@ def summary_command(
         typer.echo(result.recent_summary)
 
 
+@app.command("info")
+def info_command(
+    directory: Path | None = typer.Argument(None, help="Verzeichnis mit XML-Dateien"),
+    days: int = typer.Option(14, "--days", help="Anzahl der letzten Kalendertage für die Konsolenausgabe"),
+) -> None:
+    """Führt clients, archive-logs, session-details und summary aus."""
+    directory = directory or default_session_history()
+    try:
+        result = run_info(
+            directory,
+            DATA_DIRECTORY / "clients.csv",
+            DATA_DIRECTORY / "session_details.csv",
+            DATA_DIRECTORY / "summary.csv",
+            days,
+        )
+    except ValueError as error:
+        raise typer.BadParameter(str(error), param_hint="directory") from error
+
+    typer.echo(f"clients: {result.clients_result.row_count} Einträge")
+    typer.echo(
+        f"archive-logs: {result.archive_result.archived_count} archiviert, "
+        f"{result.archive_result.skipped_count} übersprungen"
+    )
+    typer.echo(f"session-details: {result.session_details_result.activity_count} UserActivity-Einträge")
+    typer.echo(f"summary: {result.summary_result.summary_count} Zusammenfassungen")
+    if result.summary_result.recent_summary:
+        typer.echo(result.summary_result.recent_summary)
+
+
 @app.command("session-details")
 def session_details_command(
     directory: Path | None = typer.Argument(None, help="Verzeichnis mit XML-Dateien"),