Merge lp://staging/~samuel-buffet/entertainer/bug_363066 into lp://staging/entertainer

Proposed by Samuel Buffet
Status: Merged
Approved by: Paul Hummer
Approved revision: 365
Merged at revision: not available
Proposed branch: lp://staging/~samuel-buffet/entertainer/bug_363066
Merge into: lp://staging/entertainer
Diff against target: None lines
To merge this branch: bzr merge lp://staging/~samuel-buffet/entertainer/bug_363066
Reviewer Review Type Date Requested Status
Matt Layman Approve
Jamie Bennett (community) Approve
Review via email: mp+5746@code.staging.launchpad.net

Commit message

Fixed an indentation in weather code to compensate for situations where location is not specified (fixes bug #363066)

To post a comment you must log in.
Revision history for this message
Samuel Buffet (samuel-buffet) wrote :

Hi,

A fix for Bug #363066.

It turned out that the code was already taking care of the case where no location is specified for weather forecasts.

But, because of an indentation error, we were still trying to display forecasts day per day even if the test *location == ''* was True.

Samuel-

Revision history for this message
Jamie Bennett (jamiebennett) wrote :

Surprised this bug wasn't reported sooner. Fix is good.

 review approve

On Tue, 2009-04-21 at 16:25 +0000, Samuel Buffet wrote:
> Samuel Buffet has proposed merging lp:~samuel-buffet/entertainer/bug_363066 into lp:entertainer.
>
> Requested reviews:
> Entertainer Release Team (entertainer-releases)
>
> Hi,
>
> A fix for Bug #363066.
>
> It turned out that the code was already taking care of the case where no location is specified for weather forecasts.
>
> But, because of an indentation error, we were still trying to display forecasts day per day even if the test *location == ''* was True.
>
> Samuel-

review: Approve
Revision history for this message
Matt Layman (mblayman) wrote :

I concur with Jamie. The fix seems appropriate, and I trust that you've verified that it works as advertised.

Thanks, Samuel.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'entertainerlib/frontend/gui/screens/weather.py'
--- entertainerlib/frontend/gui/screens/weather.py 2009-04-03 22:14:37 +0000
+++ entertainerlib/frontend/gui/screens/weather.py 2009-04-21 15:14:40 +0000
@@ -27,29 +27,29 @@
27 screen_title = Label(0.13, "screentitle", 0, 0.87, _("Weather"))27 screen_title = Label(0.13, "screentitle", 0, 0.87, _("Weather"))
28 self.add(screen_title)28 self.add(screen_title)
2929
30 # Show the location
31 if (self.weather.get_location() == ''):30 if (self.weather.get_location() == ''):
32 location_text = _("No weather location defined!")31 self.add(Label(0.04167, "text", 0.30, 0.20,
32 _("No weather location defined!"), font_weight="bold"))
33 else:33 else:
34 location_text = self.weather.get_location()34 location_text = self.weather.get_location()
3535
36 location = Label(0.04167, "text", 0.40, 0.13, location_text,36 location = Label(0.04167, "text", 0.40, 0.13, location_text,
37 font_weight="bold")37 font_weight="bold")
38 self.add(location)38 self.add(location)
3939
40 forecasts = self.weather.get_forecasts()40 forecasts = self.weather.get_forecasts()
4141
42 # Show today's weather42 # Show today's weather
43 self.create_day(forecasts[0], 0.1, 0.15)43 self.create_day(forecasts[0], 0.1, 0.15)
4444
45 # Show tomorrow's weather45 # Show tomorrow's weather
46 self.create_day(forecasts[1], 0.1, 0.5)46 self.create_day(forecasts[1], 0.1, 0.5)
4747
48 # Show day 348 # Show day 3
49 self.create_day(forecasts[2], 0.4, 0.5)49 self.create_day(forecasts[2], 0.4, 0.5)
5050
51 # Show day 451 # Show day 4
52 self.create_day(forecasts[3], 0.7, 0.5)52 self.create_day(forecasts[3], 0.7, 0.5)
5353
54 def create_day(self, day, x, y):54 def create_day(self, day, x, y):
55 """Create the Texture and labels for one day"""55 """Create the Texture and labels for one day"""

Subscribers

People subscribed via source and target branches