The branch, eden-pre has been updated
       via  ab72fa8943d5f00e6897dbe0c1549feb0efb7614 (commit)
      from  1aa9584702dd74459202034ab6dee4a34181dd63 (commit)

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

commit ab72fa8943d5f00e6897dbe0c1549feb0efb7614
Author: ronie <[email protected]>
Date:   Tue Jan 31 22:45:23 2012 +0100

    [weather.wunderground] -v0.0.4
    
    workaround to stop xbmc from running the script in a loop when no locations 
are set up

diff --git a/weather.wunderground/addon.xml b/weather.wunderground/addon.xml
index b28a179..0ef8cbe 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="0.0.3" 
provider-name="Team XBMC">
+<addon id="weather.wunderground" name="Weather Underground" version="0.0.4" 
provider-name="Team XBMC">
        <requires>
                <import addon="xbmc.python" version="2.0"/>
                <import addon="script.module.simplejson" version="2.0.10"/>
diff --git a/weather.wunderground/changelog.txt 
b/weather.wunderground/changelog.txt
index 572dd03..d4ce40b 100644
--- a/weather.wunderground/changelog.txt
+++ b/weather.wunderground/changelog.txt
@@ -1,3 +1,8 @@
+v0.0.4
+- don't fetch weather when no locations are set up
+- fix incrementing values on each weather refresh when no locations are set up
+- workaround: stop xbmc from running the script in a loop when no locations 
are set up
+
 v0.0.3
 - added Simplified Chinese translation
 
diff --git a/weather.wunderground/default.py b/weather.wunderground/default.py
index 632224a..c00e6d3 100644
--- a/weather.wunderground/default.py
+++ b/weather.wunderground/default.py
@@ -129,7 +129,29 @@ if sys.argv[1].startswith('Location'):
 else:
     location = __addon__.getSetting('Location%sid' % sys.argv[1])
     aik = base64.b64decode(A_I_K)
-    forecast(location)
+    if not location == '':
+        forecast(location)
+        refresh_locations()
+    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')
+        set_property('Current.WindDirection' , 'N/A')
+        set_property('Current.Humidity'      , '0')
+        set_property('Current.FeelsLike'     , '0')
+        set_property('Current.UVIndex'       , '0')
+        set_property('Current.DewPoint'      , '0')
+        set_property('Current.OutlookIcon'   , 'na.png')
+        set_property('Current.FanartCode'    , 'na')
+        for count in range (0, 3):
+            set_property('Day%i.Title'       % count, 'N/A')
+            set_property('Day%i.HighTemp'    % count, '0')
+            set_property('Day%i.LowTemp'     % count, '0')
+            set_property('Day%i.Outlook'     % count, 'N/A')
+            set_property('Day%i.OutlookIcon' % count, 'na.png')
+            set_property('Day%i.FanartCode'  % count, 'na')
+        # workaround to stop xbmc from running the script in a loop when no 
locations are set up:
+        set_property('Locations', '1')
 
-refresh_locations()
 set_property('WeatherProvider', 'Weather Underground')

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

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


hooks/post-receive
-- 
Scripts

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to