The branch, frodo has been updated
       via  5405e76c97cbff87bc56b0dfc9f677b0b4ccfebe (commit)
      from  764833238a2b57c8907c1da8ea2bfb94d31e1f8b (commit)

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

commit 5405e76c97cbff87bc56b0dfc9f677b0b4ccfebe
Author: M. Kaijser <[email protected]>
Date:   Thu Aug 15 08:22:10 2013 +0200

    [weather.ozweather] 0.6.6

diff --git a/weather.ozweather/addon.xml b/weather.ozweather/addon.xml
index 7db95a2..e43b69f 100644
--- a/weather.ozweather/addon.xml
+++ b/weather.ozweather/addon.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="weather.ozweather" name="Oz Weather" version="0.6.5" 
provider-name="Bossanova808">
+<addon id="weather.ozweather" name="Oz Weather" version="0.6.6" 
provider-name="Bossanova808">
        <requires>
                <import addon="xbmc.python" version="2.1.0"/>
     <import addon="script.module.parsedom" version="1.2.0"/>
diff --git a/weather.ozweather/changelog.txt b/weather.ozweather/changelog.txt
index 4d9de53..4678fba 100644
--- a/weather.ozweather/changelog.txt
+++ b/weather.ozweather/changelog.txt
@@ -1,3 +1,6 @@
+V0.6.6
+- Use mathematical rounding instead of skin truncating
+
 V0.6.5 
 - Bit of defensive programming to deal with parsedom and weatherzone issue
 
diff --git a/weather.ozweather/default.py b/weather.ozweather/default.py
index fed4061..e1cc4aa 100644
--- a/weather.ozweather/default.py
+++ b/weather.ozweather/default.py
@@ -260,14 +260,19 @@ def forecast(url, radarCode):
     #and now get and set all the temperatures etc.
     log("Get the forecast data from weatherzone.com.au: " + url)
     try:
-        data = fetchPage({"link":url})
-    except Exception as inst:
-        log("Error, couldn't fetchPage weather page from WeatherZone [" + url 
+ "]- error: ", inst)
+        #parsedom's fetchpage shits itself if there is any latin-1 endcoded 
stuff, but try it first anyway
+        data = common.fetchPage({"link":url})
+    except:
+        #if that fails try our local version as a falback
         try:
-            data = {}
-            data["content"] = urllib2.urlopen(url)
-        except:
-            log("Error, couldn't urlopen weather page from WeatherZone [" + 
url + "]- error: ", inst)
+            data = fetchPage({"link":url})
+        except Exception as inst:
+            log("Error, couldn't fetchPage weather page from WeatherZone [" + 
url + "]- error: ", inst)
+            try:
+                data = {}
+                data["content"] = urllib2.urlopen(url)
+            except:
+                log("Error, couldn't urlopen weather page from WeatherZone [" 
+ url + "]- error: ", inst)
            
     if data != '' and data is not None:
         propertiesPDOM(data["content"], extendedFeatures)
@@ -447,10 +452,9 @@ def propertiesPDOM(page, extendedFeatures):
         observations = common.parseDOM(ret, "td", attrs = { "class": "hilite 
bg_yellow" })
         #Observations now looks like - ['18.3&deg;C', '4.7&deg;C', 
'18.3&deg;C', '41%', 'SSW 38km/h', '48km/h', '1015.7hPa', '-', '0.0mm / -']
         log("Observations Retrieved: " + str(observations))
-        temperature = observations[0].strip( '&deg;C' )
-        log(" TEMP " + str(temperature))
-        dewPoint = observations[1].strip( '&deg;C' )
-        feelsLike = observations[2].strip( '&deg;C')
+        temperature = str(int(round(float(observations[0].strip( '&deg;C' )))))
+        dewPoint = str(int(round(float(observations[1].strip( '&deg;C' )))))
+        feelsLike = str(int(round(float(observations[2].strip( '&deg;C' )))))  
      
         humidity = observations[3].strip( '%')
         windTemp = observations[4].partition(' ');
         windDirection = windTemp[0]

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

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


hooks/post-receive
-- 
Scripts

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to