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

Proposed by Stefano Rivera
Status: Merged
Approved by: Stefano Rivera
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 Approve
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.
Revision history for this message
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
=== modified file 'ibid/plugins/__init__.py'
--- ibid/plugins/__init__.py 2011-02-27 12:33:07 +0000
+++ ibid/plugins/__init__.py 2012-11-28 10:58:21 +0000
@@ -138,8 +138,10 @@
138 args = ()138 args = ()
139 elif hasattr(event, 'message'):139 elif hasattr(event, 'message'):
140 found = True140 found = True
141 match = method.pattern.search(141 message = event.message
142 event.message[method.message_version])142 if isinstance(message, dict):
143 message = message[method.message_version]
144 match = method.pattern.search(message)
143 if match is not None:145 if match is not None:
144 args = match.groups()146 args = match.groups()
145 kwargs = match.groupdict()147 kwargs = match.groupdict()

Subscribers

People subscribed via source and target branches

to all changes: