[gdesklets-goodweather/f14: 3/4] add patch

Luya Tshimbalanga luya at fedoraproject.org
Mon Nov 7 20:04:59 UTC 2011


commit e82355f4e1def0d248a48edd92cf0247b2f1628e
Author: Luya Tshimbalanga <luya at muamba.TELUS1603>
Date:   Mon Nov 7 11:51:12 2011 -0800

    add patch

 __init__.py.patch          |  141 ++++++++++++++++++++++++++++++++++++++++++++
 gdesklets-goodweather.spec |   15 ++++-
 weather.patch              |   11 ++++
 3 files changed, 164 insertions(+), 3 deletions(-)
---
diff --git a/__init__.py.patch b/__init__.py.patch
new file mode 100644
index 0000000..a470333
--- /dev/null
+++ b/__init__.py.patch
@@ -0,0 +1,141 @@
+--- __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')
diff --git a/gdesklets-goodweather.spec b/gdesklets-goodweather.spec
index 5100a60..d14d435 100644
--- a/gdesklets-goodweather.spec
+++ b/gdesklets-goodweather.spec
@@ -1,12 +1,14 @@
 Name:           gdesklets-goodweather
 Version:        0.31
-Release:        6%{?dist}
+Release:        7%{?dist}
 Summary:        Themeable weather and condition display for gdesklet
 
 Group:          User Interface/Desktops
 License:        GPL+
 URL:            http://www.gdesklets.de
-Source0:        http://gdesklets.zencomputer.ca/GoodWeather_08-0.31.tar.gz
+Source0:        http://www.gdesklets.info/archive/GoodWeather_08-0.31.tar.gz
+Patch1: 	weather.patch
+Patch2:		__init__.py.patch
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:      noarch
@@ -21,7 +23,10 @@ conditions along with a 5 day forcast
 
 %prep
 %setup -q -n GoodWeather-08
-
+#Switch to GoodWeather directory
+cd Sensors/GoodWeather
+%patch1 -p0 -b .weather
+%patch2 -p0 -b .__init__.py
 
 %build
 
@@ -60,6 +65,10 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Mon Nov 07 2011 Luya Tshimbalanga <luya at fedoraproject.org> - 0.31-7
+- Patch for load data failure thanks to Corinna Vinschen (rhbz #674291)
+- Updated upstream url
+ 
 * Tue Feb 08 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.31-6
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
 
diff --git a/weather.patch b/weather.patch
new file mode 100644
index 0000000..c89f8d3
--- /dev/null
+++ b/weather.patch
@@ -0,0 +1,11 @@
+--- weather.py.ORIG	2011-02-20 12:41:55.899103170 +0100
++++ weather.py	2011-02-20 12:42:01.368071367 +0100
+@@ -131,7 +131,7 @@ class Weather:
+     def temperature_out(self, value):
+         if self.parent(): self.metric(self.parent().metric())
+         if int(value) < -40: 
+-            return 'N/A       '
++            return ' -        '
+         if self.metric() :
+             return str(value) + ' &#176;C'
+         return str(self.C2F(value))  + ' &#176;F'


More information about the scm-commits mailing list