Mercurial > libervia-backend
comparison sat/plugins/plugin_misc_file.py @ 3088:d1464548055a
plugin file download: meta plugin to handle file download:
- first code in backend to use async/await Python syntax \o/
- plugin with file upload
- URL schemes can be registered
- `http` and `https` schemes are handled by default
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 20 Dec 2019 12:28:04 +0100 |
parents | ab2696e34d29 |
children | 9d0df638c8b4 |
comparison
equal
deleted
inserted
replaced
3087:a51f7fce1e2c | 3088:d1464548055a |
---|---|
79 security_limit=10, | 79 security_limit=10, |
80 help_string=D_("Send a file"), | 80 help_string=D_("Send a file"), |
81 type_=C.MENU_SINGLE, | 81 type_=C.MENU_SINGLE, |
82 ) | 82 ) |
83 | 83 |
84 def _fileSend( | 84 def _fileSend(self, peer_jid_s, filepath, name="", file_desc="", extra=None, |
85 self, | 85 profile=C.PROF_KEY_NONE): |
86 peer_jid_s, | |
87 filepath, | |
88 name="", | |
89 file_desc="", | |
90 extra=None, | |
91 profile=C.PROF_KEY_NONE, | |
92 ): | |
93 client = self.host.getClient(profile) | 86 client = self.host.getClient(profile) |
94 return self.fileSend( | 87 return self.fileSend( |
95 client, jid.JID(peer_jid_s), filepath, name or None, file_desc or None, extra | 88 client, jid.JID(peer_jid_s), filepath, name or None, file_desc or None, extra |
96 ) | 89 ) |
97 | 90 |