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

Proposed by Samuel Buffet
Status: Merged
Approved by: Paul Hummer
Approved revision: 365
Merged at revision: not available
Proposed branch: lp:~samuel-buffet/entertainer/bug_363066
Merge into: lp:entertainer
Diff against target: None lines
To merge this branch: bzr merge lp:~samuel-buffet/entertainer/bug_363066
Reviewer Review Type Date Requested Status
Matt Layman Approve
Jamie Bennett (community) Approve
Review via email: mp+5746@code.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
1=== modified file 'entertainerlib/frontend/gui/screens/weather.py'
2--- entertainerlib/frontend/gui/screens/weather.py 2009-04-03 22:14:37 +0000
3+++ entertainerlib/frontend/gui/screens/weather.py 2009-04-21 15:14:40 +0000
4@@ -27,29 +27,29 @@
5 screen_title = Label(0.13, "screentitle", 0, 0.87, _("Weather"))
6 self.add(screen_title)
7
8- # Show the location
9 if (self.weather.get_location() == ''):
10- location_text = _("No weather location defined!")
11+ self.add(Label(0.04167, "text", 0.30, 0.20,
12+ _("No weather location defined!"), font_weight="bold"))
13 else:
14 location_text = self.weather.get_location()
15
16- location = Label(0.04167, "text", 0.40, 0.13, location_text,
17- font_weight="bold")
18- self.add(location)
19-
20- forecasts = self.weather.get_forecasts()
21-
22- # Show today's weather
23- self.create_day(forecasts[0], 0.1, 0.15)
24-
25- # Show tomorrow's weather
26- self.create_day(forecasts[1], 0.1, 0.5)
27-
28- # Show day 3
29- self.create_day(forecasts[2], 0.4, 0.5)
30-
31- # Show day 4
32- self.create_day(forecasts[3], 0.7, 0.5)
33+ location = Label(0.04167, "text", 0.40, 0.13, location_text,
34+ font_weight="bold")
35+ self.add(location)
36+
37+ forecasts = self.weather.get_forecasts()
38+
39+ # Show today's weather
40+ self.create_day(forecasts[0], 0.1, 0.15)
41+
42+ # Show tomorrow's weather
43+ self.create_day(forecasts[1], 0.1, 0.5)
44+
45+ # Show day 3
46+ self.create_day(forecasts[2], 0.4, 0.5)
47+
48+ # Show day 4
49+ self.create_day(forecasts[3], 0.7, 0.5)
50
51 def create_day(self, day, x, y):
52 """Create the Texture and labels for one day"""

Subscribers

People subscribed via source and target branches