updating the sort order of arrivals in Min
This commit is contained in:
@@ -262,6 +262,10 @@ class RMVApp(App):
|
|||||||
departures = fetch_departures(self.current_id)
|
departures = fetch_departures(self.current_id)
|
||||||
_, west, east = build_table_data(departures)
|
_, west, east = build_table_data(departures)
|
||||||
|
|
||||||
|
# Sortieren nach Minutenwert, wie im Lightmodus
|
||||||
|
west.sort(key=lambda row: int(row[2]) if row[2].isdigit() else 999)
|
||||||
|
east.sort(key=lambda row: int(row[2]) if row[2].isdigit() else 999)
|
||||||
|
|
||||||
self.update_table(self.table_west, west)
|
self.update_table(self.table_west, west)
|
||||||
self.update_table(self.table_east, east)
|
self.update_table(self.table_east, east)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@@ -270,7 +274,6 @@ class RMVApp(App):
|
|||||||
def update_table(self, table: DataTable, rows):
|
def update_table(self, table: DataTable, rows):
|
||||||
"""Befüllt eine DataTable mit neuen Daten und Farbcodes"""
|
"""Befüllt eine DataTable mit neuen Daten und Farbcodes"""
|
||||||
table.clear() # Nur Zeilen löschen, Spalten bleiben
|
table.clear() # Nur Zeilen löschen, Spalten bleiben
|
||||||
|
|
||||||
for line, dest, mins in rows:
|
for line, dest, mins in rows:
|
||||||
color_hex = line_colors.get(line)
|
color_hex = line_colors.get(line)
|
||||||
if color_hex:
|
if color_hex:
|
||||||
|
|||||||
Reference in New Issue
Block a user