Give the time only in minutes, to save space

This commit is contained in:
Tobias Schmidl 2021-04-28 10:03:59 +02:00
parent 96edda1f59
commit fe714bb385

View file

@ -34,8 +34,10 @@ RESULTS = sorted(map(
}, TW.summary()),
key=lambda x: x['start'])
IS_ACTIVE = len(list(filter(lambda x: "end" not in x, TW.summary()))) > 0
print("" if IS_ACTIVE else "", str(functools.reduce(lambda total, x: total + x['end'] - x['start'], RESULTS, timedelta())).split(sep='.', maxsplit=1)[0], "" if not IS_ACTIVE else "")
TOTAL_TIME = functools.reduce(lambda total, x: total + x['end'] - x['start'], RESULTS, timedelta())
TOTAL_TIME_HOURS, TOTAL_TIME_REMAINDER = divmod(int(TOTAL_TIME.total_seconds()), 3600)
TOTAL_TIME_MINUTES, _ = divmod(TOTAL_TIME_REMAINDER, 60)
print("" if IS_ACTIVE else "", f"{TOTAL_TIME_HOURS:02}:{TOTAL_TIME_MINUTES:02}", "" if not IS_ACTIVE else "")
print("---")
print(
" | font=monospace | size=8\n".join(