diff --git a/libervia/backend/core/xmpp.py b/libervia/backend/core/xmpp.py index 0b4e067f..e49731ed 100644 --- a/libervia/backend/core/xmpp.py +++ b/libervia/backend/core/xmpp.py @@ -734,31 +734,32 @@ class SatXMPPEntity(core_types.SatXMPPEntity): await self.a_send(mess_data["xml"]) return mess_data + def sendMessage( self, - to_jid, - message, - subject=None, - mess_type="auto", - extra=None, - uid=None, - no_trigger=False, - ): + to_jid: jid.JID, + message: dict[str, str], + subject: dict[str, str] | None = None, + mess_type: str = "auto", + extra: dict[str, str] | None = None, + uid: str | None = None, + no_trigger: bool = False, + ) -> defer.Deferred: r"""Send a message to an entity - @param to_jid(jid.JID): destinee of the message - @param message(dict): message body, key is the language (use '' when unknown) - @param subject(dict): message subject, key is the language (use '' when unknown) - @param mess_type(str): one of standard message type (cf RFC 6121 §5.2.2) or: + @param to_jid: destinee of the message + @param message: message body, key is the language (use '' when unknown) + @param subject: message subject, key is the language (use '' when unknown) + @param mess_type: one of standard message type (cf RFC 6121 §5.2.2) or: - auto: for automatic type detection - info: for information ("info_type" can be specified in extra) - @param extra(dict, None): extra data. Key can be: + @param extra: extra data. Key can be: - info_type: information type, can be TODO - @param uid(unicode, None): unique id: + @param uid: unique id: should be unique at least in this XMPP session if None, an uuid will be generated - @param no_trigger (bool): if True, sendMessage[suffix] trigger will no be used + @param no_trigger: if True, sendMessage[suffix] trigger will no be used useful when a message need to be sent without any modification /!\ this will also skip encryption methods! """ diff --git a/libervia/backend/plugins/plugin_comp_ap_gateway/__init__.py b/libervia/backend/plugins/plugin_comp_ap_gateway/__init__.py index 0b9aba54..17c7add1 100644 --- a/libervia/backend/plugins/plugin_comp_ap_gateway/__init__.py +++ b/libervia/backend/plugins/plugin_comp_ap_gateway/__init__.py @@ -329,7 +329,7 @@ class APGateway: ) await self.init(client) - def profile_connected(self, client): + def profile_connected(self, client) -> None: self.ad_hoc.init(client) async def _items_received( diff --git a/libervia/backend/plugins/plugin_exp_jingle_stream.py b/libervia/backend/plugins/plugin_exp_jingle_stream.py index d087f5ef..d185aa0e 100644 --- a/libervia/backend/plugins/plugin_exp_jingle_stream.py +++ b/libervia/backend/plugins/plugin_exp_jingle_stream.py @@ -34,7 +34,6 @@ from libervia.backend.core.log import getLogger from libervia.backend.tools import xml_tools from libervia.backend.tools import stream - log = getLogger(__name__) NS_STREAM = "http://salut-a-toi.org/protocol/stream" diff --git a/libervia/backend/plugins/plugin_exp_pubsub_hook.py b/libervia/backend/plugins/plugin_exp_pubsub_hook.py index 3cd01a11..69ae0fbe 100644 --- a/libervia/backend/plugins/plugin_exp_pubsub_hook.py +++ b/libervia/backend/plugins/plugin_exp_pubsub_hook.py @@ -180,7 +180,8 @@ class PubsubHook(object): except Exception as e: log.warning( _( - "Can't load Pubsub hook at node {node}, it will be removed: {reason}" + "Can't load Pubsub hook at node {node}, it will be" + " removed: {reason}" ).format(node=node, reason=e) ) hooks_list.remove(hook_data) diff --git a/libervia/backend/plugins/plugin_import.py b/libervia/backend/plugins/plugin_import.py index 60b81fe0..5388fa64 100644 --- a/libervia/backend/plugins/plugin_import.py +++ b/libervia/backend/plugins/plugin_import.py @@ -30,7 +30,6 @@ import collections import uuid import json - PLUGIN_INFO = { C.PI_NAME: "import", C.PI_IMPORT_NAME: "IMPORT", diff --git a/libervia/backend/plugins/plugin_merge_req_mercurial.py b/libervia/backend/plugins/plugin_merge_req_mercurial.py index c03e8397..bd4076e9 100644 --- a/libervia/backend/plugins/plugin_merge_req_mercurial.py +++ b/libervia/backend/plugins/plugin_merge_req_mercurial.py @@ -75,7 +75,7 @@ class MercurialHandler(object): MercurialProtocol.command = which("hg")[0] except IndexError: raise exceptions.NotFound( - _("Mercurial executable (hg) not found, " "can't use Mercurial handler") + _("Mercurial executable (hg) not found, can't use Mercurial handler") ) self.host = host self._m = host.plugins["MERGE_REQUESTS"]