summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime “pep” Buquet <pep@bouah.net>2022-03-23 16:10:36 +0100
committerMaxime “pep” Buquet <pep@bouah.net>2022-03-23 16:10:36 +0100
commitcb50120d87fa4cc4e1bdf4254c78b7d9c20fee9a (patch)
tree04fe888a30aa81f5915f1888ef7addd853bb1a51
parente010abcd95e88b4b76326ce2bd8e793506df7fb2 (diff)
downloadpoezio-cb50120d87fa4cc4e1bdf4254c78b7d9c20fee9a.tar.gz
poezio-cb50120d87fa4cc4e1bdf4254c78b7d9c20fee9a.tar.bz2
poezio-cb50120d87fa4cc4e1bdf4254c78b7d9c20fee9a.tar.xz
poezio-cb50120d87fa4cc4e1bdf4254c78b7d9c20fee9a.zip
plugins/contact: use f-strings
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
-rw-r--r--plugins/contact.py8
1 files 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']