summaryrefslogtreecommitdiff
path: root/plugins/upload.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/upload.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/upload.py')
-rw-r--r--plugins/upload.py18
1 files changed, 11 insertions, 7 deletions
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='<filename>',
- 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='<filename>',
+ 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)