Author: duncan
Date: Thu Apr 26 17:38:55 2007
New Revision: 9508

Modified:
   branches/rel-1/freevo/src/plugins/weather.py

Log:
Adjusted to be more robust, changed dataurl but this doesn't work correctly


Modified: branches/rel-1/freevo/src/plugins/weather.py
==============================================================================
--- branches/rel-1/freevo/src/plugins/weather.py        (original)
+++ branches/rel-1/freevo/src/plugins/weather.py        Thu Apr 26 17:38:55 2007
@@ -310,6 +310,7 @@
             self.popupParam = self.location
 
         self.dataurl        = 
"http://www.msnbc.com/m/chnk/d/weather_d_src.asp?acid=%s"; % (self.location,)
+        self.dataurl        = 
"http://72.9.224.178/~tpfansc/rss/weather_test_de.php?Citycode=%s"; % 
(self.location,)
         self.mapurl         = 
"http://w3.weather.com/weather/map/%s?from=LAPmaps"; % (self.location,)
         self.mapurl2        = None
         self.maplink        = None
@@ -451,6 +452,8 @@
 
         regexp  = re.compile('%s = "[^"]*"' % (var,))
         results = regexp.search(self.weatherData)
+        if not results:
+            return ''
         (start, end) = results.span()
         start += len(var) + 4 # the 4 chars is the ' = "'
         end   -= 1  # strip off the right "
@@ -583,7 +586,9 @@
         self.forecastData = self.GetString("this.swFore")
         holdings     = []
         holdings     = self.forecastData.split("|")
-        dayNum       = int(holdings[0])
+        try:
+            dayNum       = int(holdings[0])
+        except ValueError:
         curDay       = int(time.strftime("%u")) + 1 # day of week 2(mon) - 
1(sun)
 
         if dayNum != curDay:

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to