Sophie

Sophie

distrib > Fedora > 16 > x86_64 > media > updates-src > by-pkgid > 9f064d4972aec3030f8fe802152827e3 > files > 2

gdesklets-goodweather-0.31-8.fc16.src.rpm

--- __init__.py.ORIG	2011-02-20 12:41:41.817184880 +0100
+++ __init__.py	2011-02-20 22:01:27.365415901 +0100
@@ -101,7 +101,7 @@ class GoodWeatherSensor(Sensor):
                   (_("Pressure"), self.PRESSURE), 
                   (_("Location"), self.LOCATION),         
                   (_("Update Time"), self.TIME),
-		  (_("Wind Spped"), self.WSPEED)] 
+		  (_("Wind Speed"), self.WSPEED)] 
 
         configurator.add_title(_("Display"))
         configurator.add_option(_("Label 1:"), "label1",
@@ -227,7 +227,7 @@ class GoodWeatherSensor(Sensor):
                     if label1 == self.HUMIDITY: 
                          output.set("label1", "H: "+weather.humidity())
                     elif label1 == self.WINDCHILL: 
-                        output.set("label1", "W: "+weather.relative_heat())
+                        output.set("label1", "C: "+weather.relative_heat())
                     elif label1 == self.LOCATION: 
                         output.set("label1", weather.place())
                     elif label1 == self.PRESSURE: 
@@ -235,14 +235,14 @@ class GoodWeatherSensor(Sensor):
                     elif label1 == self.TIME: 
                        output.set("label1", weather.time())
 		    elif label1 == self.WSPEED: 
-                       output.set("label1", "S: " + weather.wind_speed())
+                       output.set("label1", "W: " + weather.wind_speed() + "  " + weather.wind ())
 		    else:
                        output.set("label1", weather.sky())
 
                     if label2 == self.HUMIDITY: 
                          output.set("label2", "H: " + weather.humidity())
                     elif label2 == self.WINDCHILL: 
-                        output.set("label2", "W: " + weather.relative_heat())
+                        output.set("label2", "C: " + weather.relative_heat())
                     elif label2 == self.LOCATION: 
                         output.set("label2", weather.place())
                     elif label2 == self.PRESSURE: 
@@ -250,14 +250,14 @@ class GoodWeatherSensor(Sensor):
                     elif label2 == self.TIME: 
                        output.set("label2", weather.time())
 		    elif label2 == self.WSPEED: 
-                       output.set("label2", "S: " + weather.wind_speed())
+                       output.set("label2", "W: " + weather.wind_speed() + "  " + weather.wind ())
 		    else:
                        output.set("label2", weather.sky())
 
                     if label3 == self.HUMIDITY: 
                          output.set("label3", "H: " + weather.humidity())
                     elif label3 == self.WINDCHILL: 
-                        output.set("label3", "W: " + weather.relative_heat())
+                        output.set("label3", "C: " + weather.relative_heat())
                     elif label3 == self.LOCATION: 
                         output.set("label3", weather.place())
                     elif label3 == self.PRESSURE: 
@@ -265,14 +265,14 @@ class GoodWeatherSensor(Sensor):
                     elif label3 == self.TIME: 
                        output.set("label3", weather.time())
 		    elif label3 == self.WSPEED: 
-                       output.set("label3", "S: " + weather.wind_speed())
+                       output.set("label3", "W: " + weather.wind_speed() + "  " + weather.wind ())
 		    else:
                        output.set("label3", weather.sky())
 
 		    if label4 == self.HUMIDITY: 
                          output.set("label4", "H: " + weather.humidity())
                     elif label4 == self.WINDCHILL: 
-                        output.set("label4", "W: " + weather.relative_heat())
+                        output.set("label4", "C: " + weather.relative_heat())
                     elif label4 == self.LOCATION: 
                         output.set("label4", weather.place())
                     elif label4 == self.PRESSURE: 
@@ -280,7 +280,7 @@ class GoodWeatherSensor(Sensor):
                     elif label4 == self.TIME: 
                        output.set("label4", weather.time())
 		    elif label4 == self.WSPEED: 
-                       output.set("label4", "S: " + weather.wind_speed())
+                       output.set("label4", "W: " + weather.wind_speed() + "  " + weather.wind ())
 		    else:
                        output.set("label4", weather.sky())
 		       
@@ -295,7 +295,7 @@ class GoodWeatherSensor(Sensor):
                                   icons, "small_icons", 
                                   "%(icon_nr)s.png" % vars()))
 		       output.set("temp"+str(i),
-                                  weather.get_forecast(i).temp_range())
+                                  weather.get_forecast(i).temp_range(True))
                     #end for 
 
                 except:
@@ -377,7 +377,7 @@ def parseGoodWeatherData(data):
 	#print now
 	print '==================================================='
 	p_current = r'''(?isx) # Ignore case, Dot matches all, Verbose
-	.*<tmp>(?P<temp>\d*?)</tmp> # Temp
+	.*<tmp>(?P<temp>[+-]?\d*?)</tmp> # Temp
 	\s*<flik>(?P<heat>.*?)</flik> # Heat
 	\s*<t>(?P<sky>\D+?)</t> # Sky
 	\s*<icon>(?P<icon>\d*?)</icon> # Icon
@@ -416,8 +416,8 @@ def parseGoodWeatherData(data):
 
 	p_today = r'''(?isx) # Ignore case, Dot matches all, Verbose
 	<day\sd=\"0\".*dt=\"(?P<date>.*?)\"> # Date
-	\s*?<hi>(?P<high>(\d*?|N/A))</hi> # High temperature
-	\s*?<low>(?P<low>(\d*?|N/A))</low> # Low temperature
+	\s*?<hi>(?P<high>([+-]?\d*?|N/A))</hi> # High temperature
+	\s*?<low>(?P<low>([+-]?\d*?|N/A))</low> # Low temperature
 	.*?<icon>(?P<icon>\d*?)</icon> # Icon
 	\s*?<t>(?P<sky>.*?)</t> # Sky
 	.*?<ppcp>(?P<rain>\d+)</ppcp>  # Chance of rain
@@ -438,7 +438,7 @@ def parseGoodWeatherData(data):
                     high = -100
                 if low == 'N/A': 
                     low = -100
-                if low > high:
+                if int(low) > int(high):
                     high = -100
 		
                 today.temperature_high(high, 'C')
@@ -451,9 +451,10 @@ def parseGoodWeatherData(data):
 	p_forecast = r'''(?isx) # No embedded flags, since they will be added later
 	.*?t=\"(?P<day>.*?)\" # Weekday
 	.*?dt=\"(?P<date>.*?)\"> # Day number
-	\s*?<hi>(?P<high>(\d*?|N/A))</hi> # High temperature
-	\s*?<low>(?P<low>(\d*?|N/A))</low> # Low temperature
-	.*?<icon>(?P<icon>\d*?)</icon> # Icon
+	\s*?<hi>(?P<high>([+-]?\d*?|N/A))</hi> # High temperature
+	\s*?<low>(?P<low>([+-]?\d*?|N/A))</low> # Low temperature
+	.*<part\sp=\"d\">
+	\s*?<icon>(?P<icon>\d*?)</icon> # Icon
 	\s*?<t>(?P<sky>.*?)</t> # Sky
 	.*?<ppcp>(?P<rain>\d+)</ppcp>  # Chance of rain
 	'''
@@ -475,7 +476,7 @@ def parseGoodWeatherData(data):
                     		high = -100
                 	if low == 'N/A': 
                     		low = -100
-                	if low > high:
+                	if int(low) > int(high):
                     		high = -100
 		
                 	forecast.temperature_high(high, 'C')