The branch, frodo has been updated
       via  a657aad100e0ac94148af60187ec5d08d59563d1 (commit)
      from  1d5751ec373dd036c3b70f25a62adb8a7764351b (commit)

- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=a657aad100e0ac94148af60187ec5d08d59563d1

commit a657aad100e0ac94148af60187ec5d08d59563d1
Author: ronie <ronie>
Date:   Thu May 15 11:53:05 2014 +0200

    weather.wunderground 2.0.4

diff --git a/weather.wunderground/addon.xml b/weather.wunderground/addon.xml
index abb57bb..75ea207 100644
--- a/weather.wunderground/addon.xml
+++ b/weather.wunderground/addon.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="weather.wunderground" name="Weather Underground" version="2.0.3" 
provider-name="Team XBMC">
+<addon id="weather.wunderground" name="Weather Underground" version="2.0.4" 
provider-name="Team XBMC">
        <requires>
                <import addon="xbmc.python" version="2.1.0"/>
                <import addon="script.module.simplejson" version="2.0.10"/>
diff --git a/weather.wunderground/changelog.txt 
b/weather.wunderground/changelog.txt
index 9dfc04a..314ccbb 100644
--- a/weather.wunderground/changelog.txt
+++ b/weather.wunderground/changelog.txt
@@ -1,3 +1,6 @@
+v2.0.4
+- fix crash due to api change
+
 v2.0.3
 - fixed wind was undefined in some cases
 
diff --git a/weather.wunderground/default.py b/weather.wunderground/default.py
index f253012..79b1956 100644
--- a/weather.wunderground/default.py
+++ b/weather.wunderground/default.py
@@ -188,7 +188,7 @@ def parse_data(json):
 
 def properties(data,loc,locid):
 # standard properties
-    weathercode = WEATHER_CODES[data['current_observation']['icon_url'][31:-4]]
+    weathercode = 
WEATHER_CODES[os.path.splitext(os.path.basename(data['current_observation']['icon_url']))[0]]
     set_property('Current.Location'      , loc)
     set_property('Current.Condition'     , 
data['current_observation']['weather'])
     set_property('Current.Temperature'   , 
str(data['current_observation']['temp_c']))
@@ -201,7 +201,7 @@ def properties(data,loc,locid):
     set_property('Current.OutlookIcon'   , '%s.png' % weathercode) # xbmc 
translates it to Current.ConditionIcon
     set_property('Current.FanartCode'    , weathercode)
     for count, item in 
enumerate(data['forecast']['simpleforecast']['forecastday']):
-        weathercode = WEATHER_CODES[item['icon_url'][31:-4]]
+        weathercode = 
WEATHER_CODES[os.path.splitext(os.path.basename(item['icon_url']))[0]]
         set_property('Day%i.Title'       % count, item['date']['weekday'])
         set_property('Day%i.HighTemp'    % count, str(item['high']['celsius']))
         set_property('Day%i.LowTemp'     % count, str(item['low']['celsius']))
@@ -307,7 +307,7 @@ def properties(data,loc,locid):
 # daily properties
     set_property('Daily.IsFetched', 'true')
     for count, item in 
enumerate(data['forecast']['simpleforecast']['forecastday']):
-        weathercode = WEATHER_CODES[item['icon_url'][31:-4]]
+        weathercode = 
WEATHER_CODES[os.path.splitext(os.path.basename(item['icon_url']))[0]]
         set_property('Daily.%i.LongDay'              % (count+1), 
item['date']['weekday'])
         set_property('Daily.%i.ShortDay'             % (count+1), 
item['date']['weekday_short'])
         if DATEFORMAT[1] == 'd':
@@ -360,7 +360,7 @@ def properties(data,loc,locid):
     count = 0
     for item in data['forecast']['simpleforecast']['forecastday']:
         if date(item['date']['year'], item['date']['month'], 
item['date']['day']).isoweekday() in weekend:
-            weathercode = WEATHER_CODES[item['icon_url'][31:-4]]
+            weathercode = 
WEATHER_CODES[os.path.splitext(os.path.basename(item['icon_url']))[0]]
             set_property('Weekend.%i.LongDay'                  % (count+1), 
item['date']['weekday'])
             set_property('Weekend.%i.ShortDay'                 % (count+1), 
item['date']['weekday_short'])
             if DATEFORMAT[1] == 'd':
@@ -434,7 +434,7 @@ def properties(data,loc,locid):
 # 36 hour properties
     set_property('36Hour.IsFetched', 'true')
     for count, item in 
enumerate(data['forecast']['txt_forecast']['forecastday']):
-        weathercode = WEATHER_CODES[item['icon_url'][31:-4]]
+        weathercode = 
WEATHER_CODES[os.path.splitext(os.path.basename(item['icon_url']))[0]]
         if 'F' in TEMPUNIT:
             try:
                 fcast = item['fcttext'].split('.')
@@ -480,7 +480,7 @@ def properties(data,loc,locid):
 # hourly properties
     set_property('Hourly.IsFetched', 'true')
     for count, item in enumerate(data['hourly_forecast']):
-        weathercode = WEATHER_CODES[item['icon_url'][31:-4]]
+        weathercode = 
WEATHER_CODES[os.path.splitext(os.path.basename(item['icon_url']))[0]]
         if TIMEFORMAT != '/':
             set_property('Hourly.%i.Time'            % (count+1), 
item['FCTTIME']['civil'])
         else:

-----------------------------------------------------------------------

Summary of changes:
 weather.wunderground/addon.xml     |    2 +-
 weather.wunderground/changelog.txt |    3 +++
 weather.wunderground/default.py    |   12 ++++++------
 3 files changed, 10 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
Scripts

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to