Seem to be getting some kind of pygame error opening the image all of a sudden. Was working fine for 2 months, stopped working yesterday, and upon investigation I find this:
Code:
Kobo Wifi weather forecast started.
Getting weather information . . .
Creating image . . .
Traceback (most recent call last):
File "weather.py", line 364, in <module>
get_weather_data()
File "weather.py", line 109, in get_weather_data
display(days, highs, lows, conditions, img_links, unit)
File "weather.py", line 167, in display
image = pygame.image.load(img_links[0])
pygame.error: Couldn't open icons/.png
Anyone have any idea?
Maybe something to do with some error in here getting the icons?
Code:
icons = dom.getElementsByTagName('weatherIconUrl')[1:]
img_links = []
for i in icons:
try:
link = "icons/" + str(i.firstChild.nodeValue)[72:]
except AttributeError as error:
print("Error getting icon links: " + str(error))
img_links.append(link)
Happened again on another try, this time with the following file name:
Code:
pygame.error: Couldn't open icons/y_with_light_rain.png
It looks like some how "cloud" got cut off from "cloudy_with_light_rain", not sure how to fix this. The files are right in the icons folder, but the script has the wrong variable name for that or perhaps all elements in img_links.