Merge lp:~stefanor/ibid/survive-without-core into lp:ibid

Proposed by Stefano Rivera on 2012-11-28
Status: Merged
Approved by: Stefano Rivera on 2012-12-05
Approved revision: 1055
Merged at revision: 1055
Proposed branch: lp:~stefanor/ibid/survive-without-core
Merge into: lp:ibid
Diff against target: 16 lines (+4/-2)
1 file modified
ibid/plugins/__init__.py (+4/-2)
To merge this branch: bzr merge lp:~stefanor/ibid/survive-without-core
Reviewer Review Type Date Requested Status
Jonathan Hitchcock 2012-11-28 Approve on 2012-12-05
Review via email: mp+136622@code.launchpad.net

Commit message

Handle event.message a little more delicately in ibid.plugin. We may not be using the core plugin.

Description of the change

Handle event.message a little more delicately.

Avoids this exceptions inside core ibid code when the "core" plugin isn't loaded.

To post a comment you must log in.
Jonathan Hitchcock (vhata) wrote :

Seems legit.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ibid/plugins/__init__.py'
2--- ibid/plugins/__init__.py 2011-02-27 12:33:07 +0000
3+++ ibid/plugins/__init__.py 2012-11-28 10:58:21 +0000
4@@ -138,8 +138,10 @@
5 args = ()
6 elif hasattr(event, 'message'):
7 found = True
8- match = method.pattern.search(
9- event.message[method.message_version])
10+ message = event.message
11+ if isinstance(message, dict):
12+ message = message[method.message_version]
13+ match = method.pattern.search(message)
14 if match is not None:
15 args = match.groups()
16 kwargs = match.groupdict()

Subscribers

People subscribed via source and target branches

to all changes: