From 33518cedc630bedb45501128147bf4d5b901ccdd Mon Sep 17 00:00:00 2001 From: Holger Frey Date: Fri, 15 Sep 2017 10:24:49 +0200 Subject: [PATCH] after parsing a time table, the result is sorted by the time --- arduino_timetable/timetable.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arduino_timetable/timetable.py b/arduino_timetable/timetable.py index 5ba7644..8465583 100644 --- a/arduino_timetable/timetable.py +++ b/arduino_timetable/timetable.py @@ -74,7 +74,7 @@ def parse_time_table(timetable, available_commands=None): # add a ScheduledCommand to the resulting list tc = ScheduledCommand(delta, raw_command, cmd) timed_commands.append(tc) - return timed_commands + return sorted(timed_commands, key=lambda tc: tc.delta) def parse_excel_file(path, available_commands=None): @@ -122,7 +122,7 @@ def parse_excel_file(path, available_commands=None): # add a ScheduledCommand to the resulting list tc = ScheduledCommand(delta, raw_command, cmd) timed_commands.append(tc) - return timed_commands + return sorted(timed_commands, key=lambda tc: tc.delta) def parse_time_cell(excel_cell):