Merge lp:~felix-lawrence/weather-indicator/fix-743840 into lp:weather-indicator/3.0

Proposed by Felix Lawrence
Status: Merged
Approved by: Vadim Rutkovsky
Approved revision: 239
Merged at revision: 220
Proposed branch: lp:~felix-lawrence/weather-indicator/fix-743840
Merge into: lp:weather-indicator/3.0
Diff against target: 79 lines (+16/-4)
2 files modified
bin/indicator-weather (+15/-3)
data/ui/Assistant.ui (+1/-1)
To merge this branch: bzr merge lp:~felix-lawrence/weather-indicator/fix-743840
Reviewer Review Type Date Requested Status
Vadim Rutkovsky Pending
Review via email: mp+56112@code.launchpad.net

Description of the change

Not sure whether this will fix 743840 completely, but it will stop the crash and hopefully give us some more useful debug information.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/indicator-weather'
2--- bin/indicator-weather 2011-04-02 09:09:19 +0000
3+++ bin/indicator-weather 2011-04-04 09:26:31 +0000
4@@ -384,6 +384,7 @@
5
6 #Available conditions by google icon
7 #Format: Google icon name: (day icon, night icon, is a severe weather condition)
8+ #Reference: http://www.blindmotion.com/2009/03/google-weather-api-images/
9 _GoogleConditions = {
10 "sunny" : ( "weather-clear", "weather-clear-night", False),
11 "mostly_sunny" : ( "weather-clear", "weather-clear-night", False),
12@@ -405,7 +406,7 @@
13 "haze" : ( "weather-fog", "weather-fog", False),
14 "chance_of_storm" : ( "weather-storm", "weather-storm", True),
15 "storm" : ( "weather-storm", "weather-storm", True),
16- "thunderstorm" : ( "weather-stoom", "weather-storm", True),
17+ "thunderstorm" : ( "weather-storm", "weather-storm", True),
18 "chance_of_tstorm" : ( "weather-storm", "weather-storm", True),
19 }
20
21@@ -418,7 +419,7 @@
22 '3' : ("weather-storm", "weather-storm", True, _("Severe thunderstorms")),
23 '4' : ("weather-storm", "weather-storm", True, _("Thunderstorms")),
24 '5' : ("weather-snow", "weather-snow", False, _("Mixed rain and snow")),
25- # Use Americal meaning of sleet - see http://en.wikipedia.org/wiki/Sleet
26+ # Use American meaning of sleet - see http://en.wikipedia.org/wiki/Sleet
27 '6' : ("weather-showers", "weather-showers", False, _("Mixed rain and sleet")),
28 '7' : ("weather-snow", "weather-snow", False, _("Mixed snow and sleet")),
29 '8' : ("weather-showers", "weather-showers", False, _("Freezing drizzle")),
30@@ -481,7 +482,11 @@
31 # Get data in original locale for condition name
32 self.__localized_report = pywapi.get_weather_from_google (location_id, hl = locale_name)
33 icon_name = self.__report['current_conditions']['icon'].replace('/ig/images/weather/', '').replace('.gif', '')
34+
35 self.__current_condition = self._GoogleConditions.get(icon_name)
36+ if self.__current_condition == None:
37+ log.error("ExtendedForecast: unknown Google weather condition '%s'" % icon_name)
38+ self.__current_condition = (False, False, False, _(self.__report['current_conditions']['condition']))
39
40 # Get data from Yahoo
41 if self.__weather_datasource == WeatherDataSource.YAHOO:
42@@ -1472,7 +1477,13 @@
43 # Fill in icons
44 for i in xrange(1,5):
45 # Get icon name from dictionary in Weather object for Google icons
46- google_icon = Weather._GoogleConditions[icons[i-1]][0]
47+ conds = Weather._GoogleConditions.get(icons[i-1])
48+ if conds != None:
49+ google_icon = conds[0]
50+ else:
51+ log.error("ExtendedForecast: unknown Google weather condition '%s'" % icons[i-1])
52+ log.error(forecast.forecast)
53+ google_icon = 'weather-unknown-condition'
54 self.builder.get_object('day%simage' % str(i)).set_from_icon_name(google_icon,gtk.ICON_SIZE_BUTTON)
55
56 # Fill in condition labels
57@@ -1549,6 +1560,7 @@
58 else:
59 displayed_city_name = "%s, %s" % (city['name'], city['countryName'])
60 self.store.append([displayed_city_name, str(city['geonameId']), str(city['lat']), str(city['lng']), str(city['name'])])
61+ self.location_input_combo.popup()
62 except urllib2.URLError:
63 log.error("Assistant: error reaching url '%s'" % url)
64
65
66=== modified file 'data/ui/Assistant.ui'
67--- data/ui/Assistant.ui 2011-04-02 09:09:19 +0000
68+++ data/ui/Assistant.ui 2011-04-04 09:26:31 +0000
69@@ -27,7 +27,7 @@
70 <property name="xalign">0</property>
71 <property name="yalign">0</property>
72 <property name="ypad">6</property>
73- <property name="label" translatable="yes">Please input a location in the combobox below:</property>
74+ <property name="label" translatable="yes">Please search our database for your location:</property>
75 <property name="wrap">True</property>
76 <property name="wrap_mode">word-char</property>
77 </object>
78
79=== modified file 'debian/postinst' (properties changed: -x to +x)

Subscribers

People subscribed via source and target branches