From cb50120d87fa4cc4e1bdf4254c78b7d9c20fee9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Wed, 23 Mar 2022 16:10:36 +0100 Subject: [PATCH] plugins/contact: use f-strings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- plugins/contact.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/contact.py b/plugins/contact.py index 070fbe4c..13dcc42f 100644 --- a/plugins/contact.py +++ b/plugins/contact.py @@ -40,18 +40,18 @@ class Plugin(BasePlugin): field_value = values[var] if field_value: value = sep.join(field_value) if isinstance(field_value, list) else field_value - contacts.append('%s: %s' % (title, value)) + contacts.append(f'{title}: {value}') if contacts: self.api.information('\n'.join(contacts), 'Contact Info') else: - self.api.information('No Contact Addresses for %s' % iq['from'], 'Error') + self.api.information(f'No Contact Addresses for {iq["from"]}', 'Error') async def command_disco(self, jid): try: iq = await self.core.xmpp.plugin['xep_0030'].get_info(jid=jid, cached=False) self.on_disco(iq) - except InvalidJID as e: - self.api.information('Invalid JID “%s”: %s' % (jid, e), 'Error') + except InvalidJID as exn: + self.api.information(f'Invalid JID “{jid}”: {exn}', 'Error') except (IqError, IqTimeout,) as exn: ifrom = exn.iq['from'] condition = exn.iq['error']['condition']