feat: rename --history to -a/--all; add --no-minimize flag
This commit is contained in:
parent
f03e44fd3c
commit
1e5e4f436d
@ -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...")
|
||||
|
||||
@ -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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user