Fix % formatting without a tuple.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2021-03-04 15:02:39 -08:00
parent edcb894776
commit 5b5fda2354
8 changed files with 18 additions and 18 deletions

View file

@ -64,7 +64,7 @@ class IRCBot(irc.bot.SingleServerIRCBot):
in_the_specified_stream = msg["display_recipient"] == self.stream
at_the_specified_subject = msg["subject"].casefold() == self.topic.casefold()
if in_the_specified_stream and at_the_specified_subject:
msg["content"] = ("@**%s**: " % msg["sender_full_name"]) + msg["content"]
msg["content"] = ("@**%s**: " % (msg["sender_full_name"],)) + msg["content"]
send = lambda x: self.c.privmsg(self.channel, x)
else:
return

View file

@ -72,7 +72,7 @@ def matrix_to_zulip(
"""
content = get_message_content_from_event(event, no_noise)
zulip_bot_user = ('@%s:matrix.org' % matrix_config['username'])
zulip_bot_user = '@%s:matrix.org' % (matrix_config['username'],)
# We do this to identify the messages generated from Zulip -> Matrix
# and we make sure we don't forward it again to the Zulip stream.
not_from_zulip_bot = event['sender'] != zulip_bot_user

View file

@ -231,7 +231,7 @@ def handle_event(event: Dict[str, Any]) -> None:
"subject": subject,
"content": content})
if res['result'] == 'success':
logging.info("Successfully sent Zulip with id: %s" % (res['id']))
logging.info("Successfully sent Zulip with id: %s" % (res['id'],))
else:
logging.warn("Failed to send Zulip: %s %s" % (res['result'], res['msg']))
@ -251,7 +251,7 @@ def run_mirror() -> None:
else:
since = datetime.fromtimestamp(float(timestamp), tz=pytz.utc)
except (ValueError, OSError) as e:
logging.warn("Could not open resume file: %s" % (str(e)))
logging.warn("Could not open resume file: %s" % (str(e),))
since = default_since()
try:

View file

@ -103,5 +103,5 @@ class ZulipPlugin(Component):
def ticket_deleted(self, ticket: Any) -> None:
"""Called when a ticket is deleted."""
content = "%s was deleted." % markdown_ticket_url(ticket, heading="Ticket")
content = "%s was deleted." % (markdown_ticket_url(ticket, heading="Ticket"),)
send_update(ticket, content)