From 9885203c6799c121f5bc8a733dc1937fe8c1b4d6 Mon Sep 17 00:00:00 2001 From: mathieui Date: Fri, 8 Mar 2013 22:53:35 +0100 Subject: Update the plugins to use the PluginAPI Also: - Add get_conversation_messages() to PluginAPI - Make plugins_autoload colon-separated instead of space-separated (for consistency) - Replace a JID() with a safeJID() in the uptime plugin --- plugins/simple_notify.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'plugins/simple_notify.py') diff --git a/plugins/simple_notify.py b/plugins/simple_notify.py index d274e0ee..62b1f81a 100644 --- a/plugins/simple_notify.py +++ b/plugins/simple_notify.py @@ -5,9 +5,9 @@ import shlex class Plugin(BasePlugin): def init(self): - self.add_event_handler('private_msg', self.on_private_msg) - self.add_event_handler('conversation_msg', self.on_conversation_msg) - self.add_event_handler('highlight', self.on_highlight) + self.api.add_event_handler('private_msg', self.on_private_msg) + self.api.add_event_handler('conversation_msg', self.on_conversation_msg) + self.api.add_event_handler('highlight', self.on_highlight) def on_private_msg(self, message, tab): fro = message['from'] @@ -27,7 +27,7 @@ class Plugin(BasePlugin): return command_str = self.config.get('command', '').strip() if not command_str: - self.core.information('No notification command was provided in the configuration file', 'Warning') + self.api.information('No notification command was provided in the configuration file', 'Warning') return command = [arg % {'body': body.replace('\n', ' '), 'from': fro} for arg in shlex.split(command_str)] self.core.exec_command(command) @@ -36,4 +36,4 @@ class Plugin(BasePlugin): return after_command = [arg % {'body': body.replace('\n', ' '), 'from': fro} for arg in shlex.split(after_command_str)] delayed_event = DelayedEvent(self.config.get('delay', 1), self.core.exec_command, after_command) - self.core.add_timed_event(delayed_event) + self.api.add_timed_event(delayed_event) -- cgit v1.2.3