summaryrefslogtreecommitdiff
path: root/plugins/simple_notify.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2018-08-15 13:13:17 +0200
committermathieui <mathieui@mathieui.net>2018-08-15 13:13:17 +0200
commit6e13b8b73572f9c0ac9b5c683b98a475afbeab38 (patch)
tree7dae86588339a8cf144b2d98c9280f28646341a9 /plugins/simple_notify.py
parentd1b624753bb5371cf287cc9d86bb685593a99315 (diff)
downloadpoezio-6e13b8b73572f9c0ac9b5c683b98a475afbeab38.tar.gz
poezio-6e13b8b73572f9c0ac9b5c683b98a475afbeab38.tar.bz2
poezio-6e13b8b73572f9c0ac9b5c683b98a475afbeab38.tar.xz
poezio-6e13b8b73572f9c0ac9b5c683b98a475afbeab38.zip
yapf -rip on plugins
Diffstat (limited to 'plugins/simple_notify.py')
-rw-r--r--plugins/simple_notify.py24
1 files changed, 19 insertions, 5 deletions
diff --git a/plugins/simple_notify.py b/plugins/simple_notify.py
index 60482101..cfb65e9b 100644
--- a/plugins/simple_notify.py
+++ b/plugins/simple_notify.py
@@ -94,7 +94,8 @@ from poezio import common
class Plugin(BasePlugin):
def init(self):
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('conversation_msg',
+ self.on_conversation_msg)
if self.config.get('muc_too', False):
self.api.add_event_handler('muc_msg', self.on_muc_msg)
self.api.add_event_handler('highlight', self.on_highlight)
@@ -138,13 +139,26 @@ class Plugin(BasePlugin):
return
command_str = self.config.get('command', '').strip()
if not command_str:
- self.api.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)]
+ command = [
+ arg % {
+ 'body': body.replace('\n', ' '),
+ 'from': fro
+ } for arg in shlex.split(command_str)
+ ]
self.core.exec_command(command)
after_command_str = self.config.get('after_command', '').strip()
if not after_command_str:
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)
+ 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.api.add_timed_event(delayed_event)