Browse Source

after parsing a time table, the result is sorted by the time

master
Holger Frey 7 years ago
parent
commit
33518cedc6
  1. 4
      arduino_timetable/timetable.py

4
arduino_timetable/timetable.py

@ -74,7 +74,7 @@ def parse_time_table(timetable, available_commands=None): @@ -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): @@ -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):

Loading…
Cancel
Save