summaryrefslogtreecommitdiff
path: root/plugins/send_delayed.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/send_delayed.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/send_delayed.py')
-rw-r--r--plugins/send_delayed.py24
1 files changed, 15 insertions, 9 deletions
diff --git a/plugins/send_delayed.py b/plugins/send_delayed.py
index 7a3ddc60..846fccd1 100644
--- a/plugins/send_delayed.py
+++ b/plugins/send_delayed.py
@@ -25,15 +25,18 @@ from poezio import tabs
from poezio import common
from poezio import timed_events
-class Plugin(BasePlugin):
+class Plugin(BasePlugin):
def init(self):
for _class in (tabs.PrivateTab, tabs.ConversationTab, tabs.MucTab):
- self.api.add_tab_command(_class, 'send_delayed', self.command_delayed,
- usage='<delay> <message>',
- help='Send <message> with a delay of <delay> seconds.',
- short='Send a message later',
- completion=self.completion_delay)
+ self.api.add_tab_command(
+ _class,
+ 'send_delayed',
+ self.command_delayed,
+ usage='<delay> <message>',
+ help='Send <message> with a delay of <delay> seconds.',
+ short='Send a message later',
+ completion=self.completion_delay)
@command_args_parser.quoted(2)
def command_delayed(self, args):
@@ -49,8 +52,9 @@ class Plugin(BasePlugin):
tab = self.api.current_tab()
timed_event = timed_events.DelayedEvent(delay, self.say, (tab, txt))
self.api.add_timed_event(timed_event)
- self.api.information('Delayed message will be sent in %ds (%s).'
- % (delay, delay_str), 'Info')
+ self.api.information(
+ 'Delayed message will be sent in %ds (%s).' % (delay, delay_str),
+ 'Info')
def completion_delay(self, the_input):
txt = the_input.get_text()
@@ -59,7 +63,9 @@ class Plugin(BasePlugin):
if txt.endswith(' '):
n += 1
if n == 2:
- return Completion(the_input.auto_completion, ["60", "5m", "15m", "30m", "1h", "10h", "1d"], '')
+ return Completion(the_input.auto_completion,
+ ["60", "5m", "15m", "30m", "1h", "10h", "1d"],
+ '')
def say(self, args=None):
if not args: