# HG changeset patch # User Laman # Date 2021-10-20 15:01:51 # Node ID 455d2af528a822b83cba294dd97c8d5a88c8fde3 # Parent 0e7c4e24c743a61ce02275905116b7c2d48a7583 reformatted output diff --git a/rank_progress.py b/rank_progress.py --- a/rank_progress.py +++ b/rank_progress.py @@ -2,6 +2,7 @@ import re import io from itertools import groupby from datetime import datetime +import shutil import argparse import urllib.request from zipfile import ZipFile @@ -99,6 +100,9 @@ def main(s, since, to, args): national_records = filter(lambda rec: rec.country_code == args.country_code, records) player_records = groupby(national_records, lambda rec: rec.pin) print("Detecting rank changes...") + hr = "=" * shutil.get_terminal_size().columns + found_anything = False + print(hr) for (pin, recs) in player_records: tourneys = list(recs) @@ -118,8 +122,12 @@ def main(s, since, to, args): steps = [r for r in steps if since <= r.date <= to] if steps: - print() print("\n".join(map(str, steps))) + found_anything = True + + if not found_anything: + print("Nothing found.") + print(hr) if __name__ == "__main__": @@ -149,4 +157,4 @@ if __name__ == "__main__": print("Processing...") main(s, since, to, args) - print("\nDone.") \ No newline at end of file + print("Done.")