1
0

Compare commits

..

No commits in common. "0e98fe6225cae992a954c061260994c070d8e600" and "bccc63038bbb1de4d5ca7f086bc746d67340f142" have entirely different histories.

View File

@ -32,10 +32,8 @@ def fmt_year_ranges(years: list[int]) -> str:
def fmt_line(label: Label, total_time: datetime.timedelta) -> str:
hours = int(total_time / HOUR)
minutes = int((total_time - hours * HOUR) / MINUTE)
label_str = str(label.label)
return f' {label.category:20} {label_str:50} {hours:-4d}h {minutes:-2d}m'
return f' {label.category:10} {label.label:40} {hours:-4d}h {minutes:-2d}m'
LINE_LENGTH = len(fmt_line(Label('',''), datetime.timedelta()))
def generate_report(
samples: list[RealizedActivitySample],
@ -57,7 +55,7 @@ def generate_report(
time_and_label.sort(reverse=True)
#
yield '-' * LINE_LENGTH
yield '-' * 66
yield '\n'
for total_time, label in time_and_label:
if label.category == HIDDEN_LABEL_CATEGORY:
@ -70,7 +68,7 @@ def generate_report(
yield '\n'
del label, total_time
yield '-' * LINE_LENGTH
yield '-' * 66
yield '\n'
label_total = Label(HIDDEN_LABEL_CATEGORY, 'total')