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
=== modified file 'ibid/plugins/lookup.py'
--- ibid/plugins/lookup.py 2009-10-24 14:52:52 +0000
+++ ibid/plugins/lookup.py 2009-11-30 14:00:29 +0000
@@ -98,7 +98,7 @@
98 feature = 'lotto'98 feature = 'lotto'
9999
100 za_url = 'http://www.nationallottery.co.za/'100 za_url = 'http://www.nationallottery.co.za/'
101 za_re = re.compile(r'images/balls/ball_(\d+).gif')101 za_re = re.compile(r'images/(?:power_)?balls/(?:ball|power)_(\d+).gif')
102102
103 @match(r'^lotto(\s+for\s+south\s+africa)?$')103 @match(r'^lotto(\s+for\s+south\s+africa)?$')
104 def za(self, event, za):104 def za(self, event, za):
@@ -113,20 +113,24 @@
113113
114 balls = self.za_re.findall(s)114 balls = self.za_re.findall(s)
115115
116 if len(balls) != 14:116 if len(balls) != 20:
117 event.addresponse(u'I expected to get %(expected)s balls, but found %(found)s. They were: %(balls)s', {117 event.addresponse(u'I expected to get %(expected)s balls, but found %(found)s. They were: %(balls)s', {
118 'expected': 14,118 'expected': 20,
119 'found': len(balls),119 'found': len(balls),
120 'balls': u', '.join(balls),120 'balls': u', '.join(balls),
121 })121 })
122 return122 return
123123
124 event.addresponse(u'Latest lotto results for South Africa, '124 event.addresponse(u'Latest lotto results for South Africa, '
125 u'Lotto: %(lottoballs)s (Bonus: %(lottobonus)s), Lotto Plus: %(plusballs)s (Bonus: %(plusbonus)s)', {125 u'Lotto: %(lottoballs)s (Bonus: %(lottobonus)s), '
126 'lottoballs': u" ".join(balls[:6]),126 u'Lotto Plus: %(plusballs)s (Bonus: %(plusbonus)s), '
127 u'PowerBall: %(powerballs)s PB: %(powerball)s', {
128 'lottoballs': u' '.join(balls[:6]),
127 'lottobonus': balls[6],129 'lottobonus': balls[6],
128 'plusballs': u" ".join(balls[7:13]),130 'plusballs': u' '.join(balls[7:13]),
129 'plusbonus': balls[13],131 'plusbonus': balls[13],
132 'powerballs': u' '.join(balls[14:19]),
133 'powerball': balls[19],
130 })134 })
131135
132help['fml'] = u'Retrieves quotes from fmylife.com.'136help['fml'] = u'Retrieves quotes from fmylife.com.'

Subscribers

People subscribed via source and target branches