From 6a78afd67f78d5678c46fe730df1c3b1dd6a57a0 Mon Sep 17 00:00:00 2001 From: "Schimon Jehudah, Adv." Date: Tue, 19 Nov 2024 20:09:32 +0200 Subject: [PATCH] Shorten string formatting. --- slixfeed/xmpp/chat.py | 102 ++++++--------- slixfeed/xmpp/commands.py | 261 +++++++++++++++++--------------------- 2 files changed, 154 insertions(+), 209 deletions(-) diff --git a/slixfeed/xmpp/chat.py b/slixfeed/xmpp/chat.py index 312a32c..41c1cd0 100644 --- a/slixfeed/xmpp/chat.py +++ b/slixfeed/xmpp/chat.py @@ -158,39 +158,35 @@ class XmppChat: command_list = ''.join(command_list) response = (command_list) else: - response = ('KeyError for {} {}' - .format(command_root, command_name)) + response = f'KeyError for {command_root} {command_name}' elif len(command) == 1: command = command[0] command_list = Documentation.manual( 'commands.toml', command) if command_list: command_list = ' '.join(command_list) - response = ('Available command `{}` keys:\n' - '```\n{}\n```\n' - 'Usage: `help {} `' - .format(command, command_list, command)) + response = (f'Available command `{command}` keys:\n' + f'```\n{command_list}\n```\n' + f'Usage: `help {command} `') else: - response = 'KeyError for {}'.format(command) + response = f'KeyError for {command}' else: response = ('Invalid. Enter command key ' 'or command key & name') case 'info': entries = XmppCommands.print_info_list(self) response = ('Available command options:\n' - '```\n{}\n```\n' - 'Usage: `info