From 6e13b8b73572f9c0ac9b5c683b98a475afbeab38 Mon Sep 17 00:00:00 2001 From: mathieui Date: Wed, 15 Aug 2018 13:13:17 +0200 Subject: yapf -rip on plugins --- plugins/upload.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'plugins/upload.py') diff --git a/plugins/upload.py b/plugins/upload.py index 3b2b4075..4013243a 100644 --- a/plugins/upload.py +++ b/plugins/upload.py @@ -26,24 +26,28 @@ from poezio.core.structs import Completion from poezio.decorators import command_args_parser from poezio import tabs -class Plugin(BasePlugin): +class Plugin(BasePlugin): def init(self): if not self.core.xmpp['xep_0363']: raise Exception('slixmpp XEP-0363 plugin failed to load') for _class in (tabs.PrivateTab, tabs.ConversationTab, tabs.MucTab): - self.api.add_tab_command(_class, 'upload', self.command_upload, - usage='', - help='Upload a file and auto-complete the input with its URL.', - short='Upload a file', - completion=self.completion_filename) + self.api.add_tab_command( + _class, + 'upload', + self.command_upload, + usage='', + help='Upload a file and auto-complete the input with its URL.', + short='Upload a file', + completion=self.completion_filename) async def async_upload(self, filename): try: url = await self.core.xmpp['xep_0363'].upload_file(filename) except Exception: exception = traceback.format_exc() - self.api.information('Failed to upload file: %s' % exception, 'Error') + self.api.information('Failed to upload file: %s' % exception, + 'Error') return self.core.insert_input_text(url) -- cgit v1.2.3