Mercurial > libervia-backend
diff libervia/backend/plugins/plugin_exp_invitation_file.py @ 4270:0d7bb4df2343
Reformatted code base using black.
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 19 Jun 2024 18:44:57 +0200 |
parents | 4b842c1fb686 |
children |
line wrap: on
line diff
--- a/libervia/backend/plugins/plugin_exp_invitation_file.py Tue Jun 18 12:06:45 2024 +0200 +++ b/libervia/backend/plugins/plugin_exp_invitation_file.py Wed Jun 19 18:44:57 2024 +0200 @@ -53,21 +53,35 @@ in_sign="ssssssss", out_sign="", method=self._send_file_sharing_invitation, - async_=True + async_=True, ) def _send_file_sharing_invitation( - self, invitee_jid_s, service_s, repos_type=None, namespace=None, path=None, - name=None, extra_s='', profile_key=C.PROF_KEY_NONE): + self, + invitee_jid_s, + service_s, + repos_type=None, + namespace=None, + path=None, + name=None, + extra_s="", + profile_key=C.PROF_KEY_NONE, + ): client = self.host.get_client(profile_key) invitee_jid = jid.JID(invitee_jid_s) service = jid.JID(service_s) extra = data_format.deserialise(extra_s) return defer.ensureDeferred( self.host.plugins["INVITATION"].send_file_sharing_invitation( - client, invitee_jid, service, repos_type=repos_type or None, - namespace=namespace or None, path=path or None, name=name or None, - extra=extra) + client, + invitee_jid, + service, + repos_type=repos_type or None, + namespace=namespace or None, + path=path or None, + name=name or None, + extra=extra, + ) ) def on_invitation( @@ -79,25 +93,31 @@ service: jid.JID, repos_type: str, sharing_ns: str, - path: str + path: str, ): if repos_type == "files": type_human = _("file sharing") elif repos_type == "photos": type_human = _("photo album") else: - log.warning("Unknown repository type: {repos_type}".format( - repos_type=repos_type)) + log.warning( + "Unknown repository type: {repos_type}".format(repos_type=repos_type) + ) repos_type = "file" type_human = _("file sharing") - log.info(_( - '{profile} has received an invitation for a files repository ({type_human}) ' - 'with namespace {sharing_ns!r} at path [{path}]').format( - profile=client.profile, type_human=type_human, sharing_ns=sharing_ns, - path=path) + log.info( + _( + "{profile} has received an invitation for a files repository ({type_human}) " + "with namespace {sharing_ns!r} at path [{path}]" + ).format( + profile=client.profile, + type_human=type_human, + sharing_ns=sharing_ns, + path=path, ) + ) return defer.ensureDeferred( - self.host.plugins['LIST_INTEREST'].register_file_sharing( + self.host.plugins["LIST_INTEREST"].register_file_sharing( client, service, repos_type, sharing_ns, path, name, extra ) )