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
=== modified file 'bin/indicator-weather'
--- bin/indicator-weather 2011-04-02 09:09:19 +0000
+++ bin/indicator-weather 2011-04-04 09:26:31 +0000
@@ -384,6 +384,7 @@
384384
385 #Available conditions by google icon385 #Available conditions by google icon
386 #Format: Google icon name: (day icon, night icon, is a severe weather condition)386 #Format: Google icon name: (day icon, night icon, is a severe weather condition)
387 #Reference: http://www.blindmotion.com/2009/03/google-weather-api-images/
387 _GoogleConditions = {388 _GoogleConditions = {
388 "sunny" : ( "weather-clear", "weather-clear-night", False),389 "sunny" : ( "weather-clear", "weather-clear-night", False),
389 "mostly_sunny" : ( "weather-clear", "weather-clear-night", False),390 "mostly_sunny" : ( "weather-clear", "weather-clear-night", False),
@@ -405,7 +406,7 @@
405 "haze" : ( "weather-fog", "weather-fog", False),406 "haze" : ( "weather-fog", "weather-fog", False),
406 "chance_of_storm" : ( "weather-storm", "weather-storm", True),407 "chance_of_storm" : ( "weather-storm", "weather-storm", True),
407 "storm" : ( "weather-storm", "weather-storm", True),408 "storm" : ( "weather-storm", "weather-storm", True),
408 "thunderstorm" : ( "weather-stoom", "weather-storm", True),409 "thunderstorm" : ( "weather-storm", "weather-storm", True),
409 "chance_of_tstorm" : ( "weather-storm", "weather-storm", True),410 "chance_of_tstorm" : ( "weather-storm", "weather-storm", True),
410 }411 }
411412
@@ -418,7 +419,7 @@
418 '3' : ("weather-storm", "weather-storm", True, _("Severe thunderstorms")),419 '3' : ("weather-storm", "weather-storm", True, _("Severe thunderstorms")),
419 '4' : ("weather-storm", "weather-storm", True, _("Thunderstorms")),420 '4' : ("weather-storm", "weather-storm", True, _("Thunderstorms")),
420 '5' : ("weather-snow", "weather-snow", False, _("Mixed rain and snow")),421 '5' : ("weather-snow", "weather-snow", False, _("Mixed rain and snow")),
421 # Use Americal meaning of sleet - see http://en.wikipedia.org/wiki/Sleet422 # Use American meaning of sleet - see http://en.wikipedia.org/wiki/Sleet
422 '6' : ("weather-showers", "weather-showers", False, _("Mixed rain and sleet")),423 '6' : ("weather-showers", "weather-showers", False, _("Mixed rain and sleet")),
423 '7' : ("weather-snow", "weather-snow", False, _("Mixed snow and sleet")),424 '7' : ("weather-snow", "weather-snow", False, _("Mixed snow and sleet")),
424 '8' : ("weather-showers", "weather-showers", False, _("Freezing drizzle")),425 '8' : ("weather-showers", "weather-showers", False, _("Freezing drizzle")),
@@ -481,7 +482,11 @@
481 # Get data in original locale for condition name482 # Get data in original locale for condition name
482 self.__localized_report = pywapi.get_weather_from_google (location_id, hl = locale_name)483 self.__localized_report = pywapi.get_weather_from_google (location_id, hl = locale_name)
483 icon_name = self.__report['current_conditions']['icon'].replace('/ig/images/weather/', '').replace('.gif', '')484 icon_name = self.__report['current_conditions']['icon'].replace('/ig/images/weather/', '').replace('.gif', '')
485
484 self.__current_condition = self._GoogleConditions.get(icon_name)486 self.__current_condition = self._GoogleConditions.get(icon_name)
487 if self.__current_condition == None:
488 log.error("ExtendedForecast: unknown Google weather condition '%s'" % icon_name)
489 self.__current_condition = (False, False, False, _(self.__report['current_conditions']['condition']))
485490
486 # Get data from Yahoo491 # Get data from Yahoo
487 if self.__weather_datasource == WeatherDataSource.YAHOO:492 if self.__weather_datasource == WeatherDataSource.YAHOO:
@@ -1472,7 +1477,13 @@
1472 # Fill in icons1477 # Fill in icons
1473 for i in xrange(1,5):1478 for i in xrange(1,5):
1474 # Get icon name from dictionary in Weather object for Google icons1479 # Get icon name from dictionary in Weather object for Google icons
1475 google_icon = Weather._GoogleConditions[icons[i-1]][0]1480 conds = Weather._GoogleConditions.get(icons[i-1])
1481 if conds != None:
1482 google_icon = conds[0]
1483 else:
1484 log.error("ExtendedForecast: unknown Google weather condition '%s'" % icons[i-1])
1485 log.error(forecast.forecast)
1486 google_icon = 'weather-unknown-condition'
1476 self.builder.get_object('day%simage' % str(i)).set_from_icon_name(google_icon,gtk.ICON_SIZE_BUTTON)1487 self.builder.get_object('day%simage' % str(i)).set_from_icon_name(google_icon,gtk.ICON_SIZE_BUTTON)
14771488
1478 # Fill in condition labels1489 # Fill in condition labels
@@ -1549,6 +1560,7 @@
1549 else:1560 else:
1550 displayed_city_name = "%s, %s" % (city['name'], city['countryName'])1561 displayed_city_name = "%s, %s" % (city['name'], city['countryName'])
1551 self.store.append([displayed_city_name, str(city['geonameId']), str(city['lat']), str(city['lng']), str(city['name'])])1562 self.store.append([displayed_city_name, str(city['geonameId']), str(city['lat']), str(city['lng']), str(city['name'])])
1563 self.location_input_combo.popup()
1552 except urllib2.URLError:1564 except urllib2.URLError:
1553 log.error("Assistant: error reaching url '%s'" % url)1565 log.error("Assistant: error reaching url '%s'" % url)
15541566
15551567
=== modified file 'data/ui/Assistant.ui'
--- data/ui/Assistant.ui 2011-04-02 09:09:19 +0000
+++ data/ui/Assistant.ui 2011-04-04 09:26:31 +0000
@@ -27,7 +27,7 @@
27 <property name="xalign">0</property>27 <property name="xalign">0</property>
28 <property name="yalign">0</property>28 <property name="yalign">0</property>
29 <property name="ypad">6</property>29 <property name="ypad">6</property>
30 <property name="label" translatable="yes">Please input a location in the combobox below:</property>30 <property name="label" translatable="yes">Please search our database for your location:</property>
31 <property name="wrap">True</property>31 <property name="wrap">True</property>
32 <property name="wrap_mode">word-char</property>32 <property name="wrap_mode">word-char</property>
33 </object>33 </object>
3434
=== modified file 'debian/postinst' (properties changed: -x to +x)

Subscribers

People subscribed via source and target branches