Changeset - 455d2af528a8
[Not reviewed]
default
0 1 0
Laman - 3 years ago 2021-10-20 15:01:51

reformatted output
1 file changed with 10 insertions and 2 deletions:
0 comments (0 inline, 0 general)
rank_progress.py
Show inline comments
 
@@ -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.")
0 comments (0 inline, 0 general)