chrishutchinson / train-departure-screen

Python script to display replica real-time UK railway station departure screens for SSD13xx devices
230 stars 51 forks source link

Script crashes when only one train is scheduled #12

Closed chrishutchinson closed 5 years ago

chrishutchinson commented 5 years ago

If only a single train is scheduled for a given journey configuration (departure + optional destination), then the script will crash. This is because the script attempts to render a second service, but doesn't have the required data.

Output error, for reference:

Traceback (most recent call last):
  File "./src/main.py", line 254, in <module>
    height=widgetHeight, data=data)
  File "./src/main.py", line 197, in drawSignage
    departures[1]), interval=10)
IndexError: list index out of range