Merge lp:~mgorven/ibid/weather-330862 into lp:~ibid-core/ibid/old-trunk-pack-0.92

Proposed by Michael Gorven on 2009-04-17
Status: Merged
Approved by: Jonathan Hitchcock on 2009-04-20
Approved revision: 564
Merged at revision: 597
Proposed branch: lp:~mgorven/ibid/weather-330862
Merge into: lp:~ibid-core/ibid/old-trunk-pack-0.92
Diff against target: None lines
To merge this branch: bzr merge lp:~mgorven/ibid/weather-330862
Reviewer Review Type Date Requested Status
Jonathan Hitchcock Approve on 2009-04-20
Stefano Rivera 2009-04-17 Approve on 2009-04-18
Review via email: mp+5674@code.launchpad.net
To post a comment you must log in.
Michael Gorven (mgorven) wrote :

Fixes pages which include a windchill row. Also a small fix for ibid-setup.

Stefano Rivera (stefanor) wrote :

No complaints

review: Approve
Jonathan Hitchcock (vhata) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ibid/plugins/lookup.py'
2--- ibid/plugins/lookup.py 2009-03-19 08:16:53 +0000
3+++ ibid/plugins/lookup.py 2009-04-17 22:40:23 +0000
4@@ -391,7 +391,12 @@
5 soup = self._get_page(place)
6 tds = soup.table.table.findAll('td')
7
8- values = {'place': tds[0].findAll('b')[1].contents[0], 'time': tds[0].findAll('b')[0].contents[0]}
9+ # HACK: Some cities include a windchill row, but others don't
10+ if len(tds) == 39:
11+ del tds[3]
12+ del tds[4]
13+
14+ values = {'place': tds[0].findAll('b')[1].string, 'time': tds[0].findAll('b')[0].string}
15 for index, td in enumerate(tds[2::2]):
16 values[self.labels[index]] = self._text(td)
17
18@@ -401,8 +406,8 @@
19 soup = self._get_page(place)
20 forecasts = []
21
22- for td in soup.findAll('table')[2].findAll('td', align='left'):
23- day = td.b.contents[0]
24+ for td in soup.findAll('table')[0].findAll('td', align='left'):
25+ day = td.b.string
26 forecast = td.contents[2]
27 forecasts.append(u'%s: %s' % (day, self._text(forecast)))
28
29
30=== modified file 'scripts/ibid-setup'
31--- scripts/ibid-setup 2009-04-14 10:17:42 +0000
32+++ scripts/ibid-setup 2009-04-17 22:45:57 +0000
33@@ -23,6 +23,7 @@
34 except Exception, e:
35 print >> stderr, u"Couldn't load %s plugin: %s" % (module.name.replace('ibid.plugins.', ''), unicode(e))
36
37+ibid.options = {'base': '.'}
38 if exists('ibid.ini'):
39 ibid.config = FileConfig('ibid.ini')
40 ibid.config.merge(FileConfig('local.ini'))

Subscribers

People subscribed via source and target branches