Merge lp:~roignac/ubuntu/oneiric/indicator-weather/lp_838369 into lp:ubuntu/oneiric/indicator-weather

Proposed by Vadim Rutkovsky on 2011-12-10
Status: Needs review
Proposed branch: lp:~roignac/ubuntu/oneiric/indicator-weather/lp_838369
Merge into: lp:ubuntu/oneiric/indicator-weather
Diff against target: 26 lines (+4/-3)
1 file modified
bin/indicator-weather (+4/-3)
To merge this branch: bzr merge lp:~roignac/ubuntu/oneiric/indicator-weather/lp_838369
Reviewer Review Type Date Requested Status
Andrew Starr-Bochicchio 2011-12-10 Pending
Review via email: mp+85220@code.launchpad.net

Description of the change

Backporting the fix for bug #838369 - show degrees when displaying wind direction where available

To post a comment you must log in.

Unmerged revisions

35. By Vadim Rutkovsky on 2011-12-10

Show degrees in wind direction for Yahoo

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-07-12 01:44:53 +0000
3+++ bin/indicator-weather 2011-12-10 11:01:27 +0000
4@@ -839,10 +839,10 @@
5
6 if self.__weather_datasource == WeatherDataSource.YAHOO:
7 # Create a similar to Google wind_info structure from Yahoo data
8- wind_direction = self.__localized_report['wind']['direction']
9+ wind_direction = "%s (%s˚)" % (self.get_wind_direction(self.__localized_report['wind']['direction']), self.__localized_report['wind']['direction'])
10 wind_speed = self.__localized_report['wind']['speed']
11 wind_units = self.__localized_report['units']['speed']
12- localized_wind_info = [_("Wind") + ":", self.get_wind_direction(wind_direction), ',', wind_speed, wind_units]
13+ localized_wind_info = [_("Wind") + ":", wind_direction, wind_speed, wind_units]
14
15 # Parse Wind_direction - convert to selected scale
16 if (self._wind_unit == WindUnits.MPH):
17@@ -865,7 +865,8 @@
18 localized_wind_info[len(localized_wind_info)-1] = _unit
19 localized_wind_info[len(localized_wind_info)-2] = \
20 NumberFormatter.format_float(_value, 1)
21- return ' '.join(localized_wind_info)
22+ return "%s %s %s %s" % (localized_wind_info[0], localized_wind_info[1], \
23+ localized_wind_info[2], localized_wind_info[3])
24
25 # Get sunrise label
26 def get_sunrise_label(self):

Subscribers

People subscribed via source and target branches