From 1e5e4f436de3b69b84a17fb6919082c55b57edfc Mon Sep 17 00:00:00 2001 From: Oliver Hofmann Date: Sun, 17 May 2026 18:27:00 +0200 Subject: [PATCH] feat: rename --history to -a/--all; add --no-minimize flag --- src/teampulse/cli.py | 19 +++++++++++++------ src/teampulse/monitor.py | 5 +++-- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/teampulse/cli.py b/src/teampulse/cli.py index 5ca198d..f86bb7b 100644 --- a/src/teampulse/cli.py +++ b/src/teampulse/cli.py @@ -57,17 +57,24 @@ def main() -> None: ), ) parser.add_argument( - "--history", + "-a", "--all", action="store_true", - help="Bestehende Nachrichten auswerten (Standard: nur neue Nachrichten ab Scriptstart)", + help="Alle Nachrichten auswerten inkl. bestehende (Standard: nur neue ab Scriptstart)", + ) + parser.add_argument( + "--no-minimize", + action="store_true", + help="Browser-Fenster nicht minimieren während der Aufzeichnung", ) args = parser.parse_args() - include_history: bool = args.history + include_history: bool = args.all + minimize: bool = not args.no_minimize print("─" * 60) print(" TeamPulse — Teams Chat Auswertung") print("─" * 60) - print(f" Modus: {'bestehende + neue' if include_history else 'nur neue'} Nachrichten") + print(f" Modus: {'alle' if include_history else 'nur neue'} Nachrichten") + print(f" Browser: {'sichtbar' if not minimize else 'minimiert während Aufzeichnung'}") print(" Trigger: !start Name | !stop") print(" Beenden: Ctrl+C") print("─" * 60) @@ -109,14 +116,14 @@ def main() -> None: resolver = Resolver(cache_path=CACHE_PATH, page=page) while True: - window = monitor.run_once(skip_existing=not include_history) + window = monitor.run_once(skip_existing=not include_history, minimize=minimize) # Only resolve entries that appear in the final memo # (moderator and presenter are excluded — no need to look up their email) excluded = {window.moderator, window.presenter} to_resolve = [e for e in window.entries if e.display_name not in excluded] - if to_resolve: + if to_resolve and minimize: restore_window(page) print(f"Löse {len(to_resolve)} E-Mail-Adresse(n) auf...") diff --git a/src/teampulse/monitor.py b/src/teampulse/monitor.py index 0040551..21e7f98 100644 --- a/src/teampulse/monitor.py +++ b/src/teampulse/monitor.py @@ -152,7 +152,7 @@ class Monitor: )) return new_messages - def run_once(self, skip_existing: bool = True) -> AuditWindow: + def run_once(self, skip_existing: bool = True, minimize: bool = True) -> AuditWindow: import time self.wait_for_chat() @@ -231,7 +231,8 @@ class Monitor: start_time = datetime.now() collected = [] print(f"▶ Zeitfenster gestartet — Vortragender: {presenter}") - minimize_window(self._page) + if minimize: + minimize_window(self._page) elif action == "stop": if start_time is None: