Add code to debug an issue with destinations

This commit is contained in:
Nahuel Lofeudo 2023-06-20 16:28:40 +01:00
parent a89d28129f
commit 4517bf0dbb
1 changed files with 5 additions and 0 deletions

View File

@ -47,6 +47,11 @@ def write_entry(line: int,
time_color: Color = COLOR_LCD_AMBER, text_color: Color = COLOR_LCD_AMBER):
""" Draws on the screen buffer an entry corresponding to an arrival time. """
# For some reason destination sometimes isn't a strint. Try to find out why
if not destination.__class__ == str:
print("Destination is not a string. Class: " + str(destination.__class__) + ". Value: " + str(destination))
destination = "---- ?????? ----"
# Step 1: Render the fragments
route_img = font.render(route[0:4], True, text_color)
destination_img = font.render(destination[0:21], True, text_color)