From: Edward Delaporte Date: Mon, 19 Jan 2026 20:13:45 +0000 (-0600) Subject: Update to organize tasks by subject X-Git-Url: https://apps.delaporte.us/gitweb/dotfiles.git/commitdiff_plain/e6eb1ddd96f1a8eeb1ebcd93586f70257feaec1b?ds=sidebyside Update to organize tasks by subject --- diff --git a/invoke/school/tasks.py b/invoke/school/tasks.py index e3f4928..619b54b 100644 --- a/invoke/school/tasks.py +++ b/invoke/school/tasks.py @@ -95,19 +95,24 @@ def print_day(c, person, date): print() print(f"## {person}'s Assignments for {weekday}, {date}") - for _, row in today.iterrows(): + for subject, row in today.groupby('subject'): print() print() - print(f'### {row["subject"]}') + print(f'### {row["subject"].values[0]}') print() - print(row['task']) - if(row['tip']): + for task in row['task'].values: + print(task) + if(len(row['tip'].values) > 0): print() - print(f'> Tip: {row["tip"]}') + for tip in row['tip'].values: + if tip: + print(f'> Tip: {tip}') - if(row['when_done']): + if(len(row['when_done'].values) > 0): print() - print(f'**When done**: {row["when_done"]}') + for tip in row['when_done'].values: + if tip: + print(f'**When done**: {tip}') @task def files(c):