View Single Post
Old 03-09-2016, 11:33 PM   #155
Khord
Junior Member
Khord began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jan 2016
Device: Kobo Wifi
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.

Last edited by Khord; 03-10-2016 at 03:33 AM.
Khord is offline   Reply With Quote