Merge lp:~stefanor/ibid/lotto-powerball into lp:~ibid-core/ibid/old-trunk-pack-0.92

Proposed by Stefano Rivera
Status: Merged
Approved by: Jonathan Hitchcock
Approved revision: not available
Merged at revision: 770
Proposed branch: lp:~stefanor/ibid/lotto-powerball
Merge into: lp:~ibid-core/ibid/old-trunk-pack-0.92
Diff against target: 42 lines (+10/-6)
1 file modified
ibid/plugins/lookup.py (+10/-6)
To merge this branch: bzr merge lp:~stefanor/ibid/lotto-powerball
Reviewer Review Type Date Requested Status
Jonathan Hitchcock Approve
Michael Gorven Approve
Review via email: mp+15422@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Michael Gorven (mgorven) wrote :

 review approve

review: Approve
Revision history for this message
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-10-24 14:52:52 +0000
3+++ ibid/plugins/lookup.py 2009-11-30 14:00:29 +0000
4@@ -98,7 +98,7 @@
5 feature = 'lotto'
6
7 za_url = 'http://www.nationallottery.co.za/'
8- za_re = re.compile(r'images/balls/ball_(\d+).gif')
9+ za_re = re.compile(r'images/(?:power_)?balls/(?:ball|power)_(\d+).gif')
10
11 @match(r'^lotto(\s+for\s+south\s+africa)?$')
12 def za(self, event, za):
13@@ -113,20 +113,24 @@
14
15 balls = self.za_re.findall(s)
16
17- if len(balls) != 14:
18+ if len(balls) != 20:
19 event.addresponse(u'I expected to get %(expected)s balls, but found %(found)s. They were: %(balls)s', {
20- 'expected': 14,
21+ 'expected': 20,
22 'found': len(balls),
23 'balls': u', '.join(balls),
24 })
25 return
26
27 event.addresponse(u'Latest lotto results for South Africa, '
28- u'Lotto: %(lottoballs)s (Bonus: %(lottobonus)s), Lotto Plus: %(plusballs)s (Bonus: %(plusbonus)s)', {
29- 'lottoballs': u" ".join(balls[:6]),
30+ u'Lotto: %(lottoballs)s (Bonus: %(lottobonus)s), '
31+ u'Lotto Plus: %(plusballs)s (Bonus: %(plusbonus)s), '
32+ u'PowerBall: %(powerballs)s PB: %(powerball)s', {
33+ 'lottoballs': u' '.join(balls[:6]),
34 'lottobonus': balls[6],
35- 'plusballs': u" ".join(balls[7:13]),
36+ 'plusballs': u' '.join(balls[7:13]),
37 'plusbonus': balls[13],
38+ 'powerballs': u' '.join(balls[14:19]),
39+ 'powerball': balls[19],
40 })
41
42 help['fml'] = u'Retrieves quotes from fmylife.com.'

Subscribers

People subscribed via source and target branches