From 12281e38161ed484931218984c54084c49a04f93 Mon Sep 17 00:00:00 2001 From: Campbell Alden Date: Fri, 14 Jul 2023 18:19:42 +0900 Subject: [PATCH] Fix an issue where tasks weren't being sorted --- dump.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dump.py b/dump.py index f1e0c26..1196faf 100644 --- a/dump.py +++ b/dump.py @@ -142,7 +142,7 @@ def generate_signoff_message(target_tag): for task in reportable: sanitize_mentions(task) - structured_tasks = tasks_to_heirarchy({ 'title': 'Stopping now', 'notes': '', 'status': '' }, reportable) + structured_tasks = tasks_to_heirarchy({ 'title': 'Stopping now', 'notes': '', 'status': '' }, sorted(reportable, key=by_modified_timestamp)) return format_tasks(structured_tasks, 0) def by_modified_timestamp(val): @@ -152,11 +152,11 @@ def generate_today_message(target_tag): format_tasks = make_recursive_formatter(TodayFormatter()) reportable = list(filter(lambda t: has_tag(t, target_tag), things.today())) - for task in sorted(reportable, key=by_modified_timestamp): + for task in reportable: sanitize_mentions(task) top_level_comment = ' '.join(map(lambda e: f':{e}:', random.choices(EMOJIS, k=3))) - structured_tasks = tasks_to_heirarchy({ 'title': top_level_comment, 'notes': '' }, reportable) + structured_tasks = tasks_to_heirarchy({ 'title': top_level_comment, 'notes': '' }, sorted(reportable, key=by_modified_timestamp)) return format_tasks(structured_tasks, 0) def generate_track_message(target_tag):