Skip to content

Commit

Permalink
📝 Sundry python lint
Browse files Browse the repository at this point in the history
  • Loading branch information
akrherz committed Jan 13, 2025
1 parent a49c86f commit aebafc5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/iembot/basicbot.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"""Basic iembot/nwsbot implementation."""

import copy
import datetime
import os
import pickle
import random
import re
import traceback
from collections import namedtuple
from datetime import timedelta
from io import StringIO
from xml.etree import ElementTree as ET

Expand Down Expand Up @@ -418,7 +418,7 @@ def compute_daily_caller(self):
"""Figure out when to be called"""
log.msg("compute_daily_caller() called...")
# Figure out when to spam all rooms with a timestamp
utcnow = utc() + datetime.timedelta(days=1)
utcnow = utc() + timedelta(days=1)
tnext = utcnow.replace(hour=0, minute=0, second=0)
log.msg(
"Initial Calling daily_timestamp in "
Expand Down Expand Up @@ -735,7 +735,7 @@ def handle_flood_request(self, elem, bstring):
with star trek quotes, yes!
"""
_from = jid.JID(elem["from"])
if not re.match(r"^nws-", _from.user):
if not re.match("^nws-", str(_from.user)):
msg = "Sorry, you must be NWS to flood a chatroom!"
self.send_privatechat(elem["from"], msg)
return
Expand Down
4 changes: 2 additions & 2 deletions src/iembot/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ def twitter_errback(err, bot, user_id, tweettext):
disable_twitter_user(bot, user_id, errcode)
else:
sn = bot.tw_users.get(user_id, {}).get("screen_name", "")
msg = f"User: {user_id} ({sn})\n" f"Failed to tweet: {tweettext}"
msg = f"User: {user_id} ({sn})\nFailed to tweet: {tweettext}"
email_error(err, bot, msg)


Expand Down Expand Up @@ -534,7 +534,7 @@ def mastodon_errback(err, bot, user_id, tweettext):
disable_mastodon_user(bot, user_id, errcode)
else:
sn = bot.md_users.get(user_id, {}).get("screen_name", "")
msg = f"User: {user_id} ({sn})\n" f"Failed to toot: {tweettext}"
msg = f"User: {user_id} ({sn})\nFailed to toot: {tweettext}"
email_error(err, bot, msg)


Expand Down

0 comments on commit aebafc5

Please sign in to comment.