Mercurial > libervia-backend
diff libervia/backend/plugins/plugin_misc_text_commands.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_misc_text_commands.py Tue Jun 18 12:06:45 2024 +0200 +++ b/libervia/backend/plugins/plugin_misc_text_commands.py Wed Jun 19 18:44:57 2024 +0200 @@ -151,7 +151,7 @@ return data def register_text_commands(self, instance): - """ Add a text command + """Add a text command @param instance: instance of a class containing text commands """ @@ -196,12 +196,12 @@ def send_message_trigger( self, client, mess_data, pre_xml_treatments, post_xml_treatments ): - """Install SendMessage command hook """ + """Install SendMessage command hook""" pre_xml_treatments.addCallback(self._send_message_cmd_hook, client) return True def _send_message_cmd_hook(self, mess_data, client): - """ Check text commands in message, and react consequently + """Check text commands in message, and react consequently msg starting with / are potential command. If a command is found, it is executed, else an help message is sent. @@ -248,7 +248,7 @@ # looks like an actual command, we try to call the corresponding method def ret_handling(ret): - """ Handle command return value: + """Handle command return value: if ret is True, normally send message (possibly modified by command) else, abord message sending """ @@ -381,9 +381,7 @@ d = defer.succeed(None) for __, callback in self._whois: - d.addCallback( - lambda __: callback(client, whois_msg, mess_data, target_jid) - ) + d.addCallback(lambda __: callback(client, whois_msg, mess_data, target_jid)) def feed_back(__): self.feed_back(client, "\n".join(whois_msg), mess_data) @@ -464,7 +462,10 @@ short_help=cmd_data["doc_short_help"], syntax=_(" " * 4 + "syntax: {}\n").format(syntax) if syntax else "", args_help="\n".join( - [" " * 8 + "{}".format(line) for line in self._get_args_help(cmd_data)] + [ + " " * 8 + "{}".format(line) + for line in self._get_args_help(cmd_data) + ] ), )