|
@@ -25,8 +25,8 @@ def app_callback(context: typer.Context) -> None:
|
|
|
typer.echo(context.get_help())
|
|
typer.echo(context.get_help())
|
|
|
|
|
|
|
|
|
|
|
|
|
-@app.command()
|
|
|
|
|
-def clients(
|
|
|
|
|
|
|
+@app.command("clients")
|
|
|
|
|
+def clients_command(
|
|
|
directory: Path | None = typer.Argument(None, help="Verzeichnis mit XML-Dateien"),
|
|
directory: Path | None = typer.Argument(None, help="Verzeichnis mit XML-Dateien"),
|
|
|
output: Path = typer.Option(DATA_DIRECTORY / "clients.csv", "--output", "-o", help="Zielpfad der CSV-Datei"),
|
|
output: Path = typer.Option(DATA_DIRECTORY / "clients.csv", "--output", "-o", help="Zielpfad der CSV-Datei"),
|
|
|
) -> None:
|
|
) -> None:
|
|
@@ -39,8 +39,8 @@ def clients(
|
|
|
typer.echo(f"{xml_count} XML-Dateien gelesen, {row_count} Einträge nach {output} geschrieben.")
|
|
typer.echo(f"{xml_count} XML-Dateien gelesen, {row_count} Einträge nach {output} geschrieben.")
|
|
|
|
|
|
|
|
|
|
|
|
|
-@app.command()
|
|
|
|
|
-def files(
|
|
|
|
|
|
|
+@app.command("files")
|
|
|
|
|
+def files_command(
|
|
|
directory: Path | None = typer.Argument(None, help="Verzeichnis mit XML-Dateien"),
|
|
directory: Path | None = typer.Argument(None, help="Verzeichnis mit XML-Dateien"),
|
|
|
output: Path = typer.Option(DATA_DIRECTORY / "files.csv", "--output", "-o", help="Zielpfad der CSV-Datei"),
|
|
output: Path = typer.Option(DATA_DIRECTORY / "files.csv", "--output", "-o", help="Zielpfad der CSV-Datei"),
|
|
|
ignore_timestamp: bool = typer.Option(
|
|
ignore_timestamp: bool = typer.Option(
|
|
@@ -60,14 +60,22 @@ def files(
|
|
|
|
|
|
|
|
@app.command("move-files")
|
|
@app.command("move-files")
|
|
|
def move_files_command(
|
|
def move_files_command(
|
|
|
|
|
+ directory: Path | None = typer.Argument(None, help="Verzeichnis mit XML-Dateien"),
|
|
|
files_csv: Path = typer.Option(
|
|
files_csv: Path = typer.Option(
|
|
|
DATA_DIRECTORY / "files.csv", "--files-csv", help="CSV-Datei mit den gefundenen Dateien"
|
|
DATA_DIRECTORY / "files.csv", "--files-csv", help="CSV-Datei mit den gefundenen Dateien"
|
|
|
),
|
|
),
|
|
|
clients_csv: Path = typer.Option(DATA_DIRECTORY / "clients.csv", "--clients-csv", help="CSV-Datei mit den Kunden"),
|
|
clients_csv: Path = typer.Option(DATA_DIRECTORY / "clients.csv", "--clients-csv", help="CSV-Datei mit den Kunden"),
|
|
|
desktop: Path | None = typer.Option(None, "--desktop", help="Desktop-Verzeichnis als Zielbasis"),
|
|
desktop: Path | None = typer.Option(None, "--desktop", help="Desktop-Verzeichnis als Zielbasis"),
|
|
|
|
|
+ ignore_timestamp: bool = typer.Option(
|
|
|
|
|
+ False,
|
|
|
|
|
+ "--ignore-timestamp",
|
|
|
|
|
+ help="Ignoriert den Abgleich des Erstellungsdatums mit der Session.",
|
|
|
|
|
+ ),
|
|
|
) -> None:
|
|
) -> None:
|
|
|
"""Verschiebt gefundene Dateien in Desktop/PC-Visit/Kunde."""
|
|
"""Verschiebt gefundene Dateien in Desktop/PC-Visit/Kunde."""
|
|
|
|
|
+ directory = directory or default_session_history()
|
|
|
try:
|
|
try:
|
|
|
|
|
+ run_files(directory, files_csv, ignore_timestamp=ignore_timestamp)
|
|
|
moved_count, skipped_count, missing_client_count = move_files(
|
|
moved_count, skipped_count, missing_client_count = move_files(
|
|
|
files_csv, clients_csv, desktop or default_desktop()
|
|
files_csv, clients_csv, desktop or default_desktop()
|
|
|
)
|
|
)
|
|
@@ -79,7 +87,7 @@ def move_files_command(
|
|
|
|
|
|
|
|
|
|
|
|
|
@app.command("archive-logs")
|
|
@app.command("archive-logs")
|
|
|
-def archive_logs(
|
|
|
|
|
|
|
+def archive_logs_command(
|
|
|
directory: Path | None = typer.Argument(None, help="Verzeichnis mit XML-Dateien"),
|
|
directory: Path | None = typer.Argument(None, help="Verzeichnis mit XML-Dateien"),
|
|
|
) -> None:
|
|
) -> None:
|
|
|
"""Archiviert Session-XML-Dateien nach Jahr."""
|
|
"""Archiviert Session-XML-Dateien nach Jahr."""
|
|
@@ -91,8 +99,8 @@ def archive_logs(
|
|
|
typer.echo(f"{checked_count} XML-Dateien geprüft, {archived_count} archiviert, " f"{skipped_count} übersprungen.")
|
|
typer.echo(f"{checked_count} XML-Dateien geprüft, {archived_count} archiviert, " f"{skipped_count} übersprungen.")
|
|
|
|
|
|
|
|
|
|
|
|
|
-@app.command()
|
|
|
|
|
-def summary(
|
|
|
|
|
|
|
+@app.command("summary")
|
|
|
|
|
+def summary_command(
|
|
|
directory: Path | None = typer.Argument(None, help="Verzeichnis mit XML-Dateien"),
|
|
directory: Path | None = typer.Argument(None, help="Verzeichnis mit XML-Dateien"),
|
|
|
output: Path = typer.Option(DATA_DIRECTORY / "summary.csv", "--output", "-o", help="Zielpfad der CSV-Datei"),
|
|
output: Path = typer.Option(DATA_DIRECTORY / "summary.csv", "--output", "-o", help="Zielpfad der CSV-Datei"),
|
|
|
) -> None:
|
|
) -> None:
|