diff options
author | theuni <theuni-nospam-@xbmc.org> | 2012-03-20 22:55:55 -0400 |
---|---|---|
committer | theuni <theuni-nospam-@xbmc.org> | 2012-03-20 23:07:25 -0400 |
commit | ef5c76c23263f50ca70e2069444dd3a8d8c00e3b (patch) | |
tree | 11695e6f2c6a351937e8208a7cc1bf568c30f4fd /addons/weather.wunderground | |
parent | 62dda1b71d144b1de584738c0c7b4335e9932171 (diff) |
release: sync wunderground with addons repo
Diffstat (limited to 'addons/weather.wunderground')
-rw-r--r-- | addons/weather.wunderground/addon.xml | 4 | ||||
-rw-r--r-- | addons/weather.wunderground/changelog.txt | 7 | ||||
-rw-r--r-- | addons/weather.wunderground/default.py | 20 | ||||
-rw-r--r-- | addons/weather.wunderground/resources/language/Chinese (Simple)/strings.xml | 2 |
4 files changed, 21 insertions, 12 deletions
diff --git a/addons/weather.wunderground/addon.xml b/addons/weather.wunderground/addon.xml index 157565a95e..93963931fd 100644 --- a/addons/weather.wunderground/addon.xml +++ b/addons/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="0.0.7" provider-name="Team XBMC"> +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<addon id="weather.wunderground" name="Weather Underground" version="0.0.9" provider-name="Team XBMC"> <requires> <import addon="xbmc.python" version="2.0"/> <import addon="script.module.simplejson" version="2.0.10"/> diff --git a/addons/weather.wunderground/changelog.txt b/addons/weather.wunderground/changelog.txt index 8640648ed0..f9c0fe010c 100644 --- a/addons/weather.wunderground/changelog.txt +++ b/addons/weather.wunderground/changelog.txt @@ -1,3 +1,10 @@ +v0.0.9 +- clear 7 day labels not 6 +- save only the actual location code + +v0.0.8 +- fix error if no internet connection is available when searching for a location + v0.0.7 - fix: import error on Windows with non/extended-ascii profile paths diff --git a/addons/weather.wunderground/default.py b/addons/weather.wunderground/default.py index 009f0f5e3b..5d7eae40d5 100644 --- a/addons/weather.wunderground/default.py +++ b/addons/weather.wunderground/default.py @@ -27,7 +27,7 @@ sys.path.append (__resource__) from utilities import * LOCATION_URL = 'http://autocomplete.wunderground.com/aq?query=%s&format=JSON' -WEATHER_URL = 'http://api.wunderground.com/api/%s/conditions/forecast7day/hourly%s.json' +WEATHER_URL = 'http://api.wunderground.com/api/%s/conditions/forecast7day/hourly/q/%s.json' GEOIP_URL = 'http://api.wunderground.com/api/%s/geolookup/q/autoip.json' A_I_K = 'NDEzNjBkMjFkZjFhMzczNg==' WEATHER_WINDOW = xbmcgui.Window(12600) @@ -78,17 +78,18 @@ def location(string): loc = [] locid = [] query = fetch(LOCATION_URL % (urllib2.quote(string))) - for item in query['RESULTS']: - location = item['name'] - locationid = item['l'] - loc.append(location) - locid.append(locationid) + if query != '': + for item in query['RESULTS']: + location = item['name'] + locationid = item['l'][3:] + loc.append(location) + locid.append(locationid) return loc, locid def geoip(): data = fetch(GEOIP_URL % aik[::-1]) if data != '' and data.has_key('location'): - location = data['location']['l'] + location = data['location']['l'][3:] __addon__.setSetting('Location1', data['location']['city']) __addon__.setSetting('Location1id', location) else: @@ -147,9 +148,10 @@ else: if location == '': location = geoip() if not location == '': + if location.startswith('/q/'): # backwards compatibility + location = location[3:] forecast(location) else: - # workaround to fix incrementing values on each weather refresh when no locations are set up: set_property('Current.Condition' , 'N/A') set_property('Current.Temperature' , '0') set_property('Current.Wind' , '0') @@ -160,7 +162,7 @@ else: set_property('Current.DewPoint' , '0') set_property('Current.OutlookIcon' , 'na.png') set_property('Current.FanartCode' , 'na') - for count in range (0, MAXDAYS): + for count in range (0, MAXDAYS+1): set_property('Day%i.Title' % count, 'N/A') set_property('Day%i.HighTemp' % count, '0') set_property('Day%i.LowTemp' % count, '0') diff --git a/addons/weather.wunderground/resources/language/Chinese (Simple)/strings.xml b/addons/weather.wunderground/resources/language/Chinese (Simple)/strings.xml index ab8b025eb2..bf8ec85537 100644 --- a/addons/weather.wunderground/resources/language/Chinese (Simple)/strings.xml +++ b/addons/weather.wunderground/resources/language/Chinese (Simple)/strings.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<?xml version="1.0" encoding="utf-8" standalone="yes"?> <strings> <string id="30101">所在地设置</string> <string id="30111">更改地点1</string> |