From 44eec4dbee3a719091473378c35c87eff1296016 Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Tue, 5 Sep 2023 13:58:20 +0200 Subject: [PATCH] migrate.py: Refactor member warning/invalid functions --- wgmaster/migrate.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wgmaster/migrate.py b/wgmaster/migrate.py index 2100452..3b0365c 100755 --- a/wgmaster/migrate.py +++ b/wgmaster/migrate.py @@ -150,11 +150,13 @@ def success(mgnr: int, key: str, value) -> None: def warning(mgnr: int, key: str, value, active: bool) -> None: - print(f'\x1B[1;33m{mgnr:>6} ({"A" if active else " "}): {key:<12} {value}\x1B[0m', file=sys.stderr) + act = 'A' if active else '?' if active is None else ' ' + print(f'\x1B[1;33m{mgnr:>6} ({act}): {key:<12} {value}\x1B[0m', file=sys.stderr) def invalid(mgnr: int, key: str, value, active: Optional[bool]) -> None: - print(f'\x1B[1;31m{mgnr:>6} ({"A" if active else "?" if active is None else " "}): {key:<12} {value}\x1B[0m', file=sys.stderr) + act = 'A' if active else '?' if active is None else ' ' + print(f'\x1B[1;31m{mgnr:>6} ({act}): {key:<12} {value}\x1B[0m', file=sys.stderr) def renumber_delivery(lsnr_1: str, lsnr_2: str) -> None: