Kodi Community Forum

Full Version: Weather Underground
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Sorry. No. I have almost the same error...
Code:
05:35:07 T:4556  NOTICE: -->Python Interpreter Initialized<--
05:35:10 T:4556   ERROR: Error Type: <type 'exceptions.TypeError'>
05:35:10 T:4556   ERROR: Error Contents: 'NoneType' object is not iterable
05:35:10 T:4556   ERROR: Traceback (most recent call last):
                                              File "C:\Users\User\AppData\Roaming\XBMC\addons\weather.wunderground\default.py", line 544, in <module>
                                                forecast(location)
                                              File "C:\Users\User\AppData\Roaming\XBMC\addons\weather.wunderground\default.py", line 144, in forecast
                                                properties(data,loc)
                                              File "C:\Users\User\AppData\Roaming\XBMC\addons\weather.wunderground\default.py", line 491, in properties
                                                for item in json_response['result']['files']:
                                            TypeError: 'NoneType' object is not iterable

Also, maybe is from the above error but the day labels in weekend are mixed up

Image
I get the same error and I think I know how to fix.

Change line 490 of default.py to:
PHP Code:
if json_response['result']['files']: 
I see many different screens pass by but i'm not getting them on my system?

I'm using MQ3 skin and eveytime i select weather i'm getting a popup to select a location instead of the screens shown here.
Selecting that location doesn't do anything then.

Any ideas?
You already have your location setup i guess?
Try another skin and see if that one does work.
(2012-05-06, 11:27)Martijn Wrote: [ -> ]I get the same error and I think I know how to fix.

Change line 490 of default.py to:
PHP Code:
if json_response['result']['files']: 

Martijn... that worked. No script error any more although i still have the mixed up day labels in weekend page and some weird high/low temp info in 36hour page if i select "English (US)" in XBMC International settings...

Image
(2012-05-06, 13:56)nessus Wrote: [ -> ]i still have the mixed up day labels in weekend page

mixed up... mixed up... i'd say different :-)
at least different, to what you expect (or were used to) it to be.


we don't have access to yesterdays (or the day before) weather data, so i can't provide them.
instead, you'll get the forecast for the next weekend.
weather.wunderground-0.1.9.zip

fixed:
- json error when no image files are found
- 36 hour heading and temp (again, i hope for real this time)
- better detection of systems that use AM/PM time format
- provide windspeeds in beaufort for systems that use it (greek users only afaik)
You are right about the weekend day labels. My bad. I remember now that weather+ was showing blank the past day's on current weekend.

There still some other typo problems when changing international settings but i will stop now to bothering you more with this .

Thanks

Cheers
Nessus
(2012-05-06, 21:49)nessus Wrote: [ -> ]There still some other typo problems when changing international settings but i will stop now to bothering you more with this .

oh, no please don't... if there's any issues,
no matter how small, i'd like to know about it.

and thx for all the testing & reporting you've done so far :-)
In the 10 Day, Weekend, and Hourly screens, wind speed is reported in mp/h; in the 36 Hour screen, however, wind speed is reported in km/h.
This is probably a localisation issue?
(2012-05-06, 22:01)dnairb Wrote: [ -> ]In the 10 Day, Weekend, and Hourly screens, wind speed is reported in mp/h; in the 36 Hour screen, however, wind speed is reported in km/h.
This is probably a localisation issue?

that's for a location in england i guess?

wunderground provides the 36 hour forecast in either '°C & km/h' or '°F & mph' format.
this works for everyone, except for the brits, who insist on using '°C & mph' ;-)

i'll try if i can use some trickery in the script to handle the conversion for UK based locations.
It is in UK, yes. The localisation works OK with the 10 day, weekend and hourly screens, just not on the 36 hour screen.
(2012-05-06, 21:53)ronie Wrote: [ -> ]
(2012-05-06, 21:49)nessus Wrote: [ -> ]There still some other typo problems when changing international settings but i will stop now to bothering you more with this .

oh, no please don't... if there's any issues,
no matter how small, i'd like to know about it.

and thx for all the testing & reporting you've done so far :-)

In that case here some screens of what i think there are errors. I marked with red circle what i think is wrong.

These are with International Settings set to "Greek" :
Image
Image


This is with International Settings set to "English (US)" :
Image


This is with International Settings set to "English" :
Image
@nessus:

the first two screenshots:
- as far as i understand, (you obviously would know better than me),
windspeeds in greece are reported in beaufort. so please let me know why you think Bft is incorrect.

- 'Variable' is indeed not translated. we can blame wunderground for not localizing this string.
we can blame xbmc as well, as it also tries to localize strings on the weather screen.
problem is, we still have the weather.com strings in our language files and they used 'VAR'.
other then that, if you switch to a greek location (i've tested with Athens), wunderground does provide proper localized strings

- AM/PM, that's indeed the script's fault. i could try to fix that.
how should greek time be displayed? as '6:20πμ / 9:13μμ' or just '6:20 / 9:13' ?


last two screenshots:
wundergound doesn't provide the individual 36hour.header and 36hour.temp values.
i have to extract them from the forecast text:

Image

so far, i can't think of any other way to do this, so it's the best i can do for now.
Ronie... indeed wind speeds in Greece are reported in Beaufort ("Μποφόρ" in Greek). I've marked "Variable", "Beaufort", "Bft" just for localizing reasons. If that is not script depended never mind then. IMO "Beaufort" metric is not needed if is not localized/translated. Reading a sentence of 5-6 words in two languages is not easy looking.

The Greek time is displayed like you say : 6:20πμ / 9:13μμ but also a 24h look (6:20 / 21:13) it will be fine and more universal in all languages.

I had no idea that you take the values for 36hour.header and 36hour.temp from there. In that case is ok.

Cheers
Nessus