From e6dc6b06cbb9a99bf8451ba0a3419b84a6227f3b Mon Sep 17 00:00:00 2001 From: Midgard Date: Thu, 25 Apr 2024 21:33:38 +0200 Subject: [PATCH] Change report format slightly and add options --- report_numberdealers.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/report_numberdealers.py b/report_numberdealers.py index 20ded32..32c87fe 100755 --- a/report_numberdealers.py +++ b/report_numberdealers.py @@ -5,6 +5,7 @@ from numberdealers import parse_numberdealers, times, report_errors, numbers_per def main(): + channel = sys.argv[1] numbers, errors = parse_numberdealers.parse(sys.stdin) if numbers == [] and errors == []: @@ -14,21 +15,20 @@ def main(): print("No valid number messages!") return - print(f"Checked from {numbers[0].recognized_number} up to {numbers[-1].recognized_number}") - print() - report_errors.report_errors(errors) - print() - print("---") - print() - print("```") - times.report_times(numbers) - print("```") - print() - print("---") - print() - print("```") - numbers_per_user.report_users(numbers) - print("```") + print(f"##### Checked ~{channel} from {numbers[0].recognized_number} up to {numbers[-1].recognized_number}") + if "--no-errors" not in sys.argv[2:]: + print() + report_errors.report_errors(errors) + if "--no-times" not in sys.argv[2:]: + print() + print("```") + times.report_times(numbers) + print("```") + if "--no-users" not in sys.argv[2:]: + print() + print("```") + numbers_per_user.report_users(numbers) + print("```") if __name__ == "__main__":