diff --git a/bot.py b/bot.py index 899c1c6..68c3d1a 100644 --- a/bot.py +++ b/bot.py @@ -86,7 +86,9 @@ class MastodonRSSBot: try: feed = feedparser.parse(feed_url) if hasattr(feed, "bozo_exception"): - print(f"Warning: Feed parsing issue for {feed_url}: {feed.bozo_exception}") + print( + f"Warning: Feed parsing issue for {feed_url}: {feed.bozo_exception}" + ) return feed except Exception as e: print(f"Error parsing feed {feed_url}: {e}") diff --git a/main.py b/main.py index 597ec97..6826401 100644 --- a/main.py +++ b/main.py @@ -17,7 +17,9 @@ def main(): # 2. Comma-separated list of feeds if os.environ.get("RSS_FEEDS"): - feeds = [url.strip() for url in os.environ["RSS_FEEDS"].split(",") if url.strip()] + feeds = [ + url.strip() for url in os.environ["RSS_FEEDS"].split(",") if url.strip() + ] feed_urls.extend(feeds) # 3. File containing list of feeds @@ -25,7 +27,11 @@ def main(): if feeds_file and os.path.exists(feeds_file): try: with open(feeds_file, "r") as f: - file_feeds = [line.strip() for line in f if line.strip() and not line.startswith("#")] + file_feeds = [ + line.strip() + for line in f + if line.strip() and not line.startswith("#") + ] feed_urls.extend(file_feeds) except Exception as e: print(f"Error reading feeds file {feeds_file}: {e}") @@ -39,7 +45,9 @@ def main(): seen.add(url) if not unique_feed_urls: - print("Error: No RSS feeds configured. Please set RSS_FEED_URL, RSS_FEEDS, or FEEDS_FILE.") + print( + "Error: No RSS feeds configured. Please set RSS_FEED_URL, RSS_FEEDS, or FEEDS_FILE." + ) return bot = MastodonRSSBot( diff --git a/test_bot.py b/test_bot.py index d67ed8d..736595a 100644 --- a/test_bot.py +++ b/test_bot.py @@ -400,6 +400,7 @@ class TestMainEntry(unittest.TestCase): del os.environ["RSS_FEED_URL"] from main import main + mock_bot_instance = Mock() mock_bot_class.return_value = mock_bot_instance