From 6d82dd93267b4a10ac0cfb977e2565fbb97d541b Mon Sep 17 00:00:00 2001 From: Marcel Weschke Date: Thu, 14 Aug 2025 16:45:33 +0200 Subject: [PATCH] updating the sort order of arrivals in Min --- RMV_Digital_Board_light.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/RMV_Digital_Board_light.py b/RMV_Digital_Board_light.py index 29ae31c..0918bd7 100644 --- a/RMV_Digital_Board_light.py +++ b/RMV_Digital_Board_light.py @@ -262,6 +262,10 @@ class RMVApp(App): departures = fetch_departures(self.current_id) _, 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_east, east) except Exception as e: @@ -270,7 +274,6 @@ class RMVApp(App): def update_table(self, table: DataTable, rows): """Befüllt eine DataTable mit neuen Daten und Farbcodes""" table.clear() # Nur Zeilen löschen, Spalten bleiben - for line, dest, mins in rows: color_hex = line_colors.get(line) if color_hex: