From e10ed420c1209c9fec74ff77522710a7e138fb6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Hells=C3=A9n?= Date: Fri, 23 Dec 2022 21:58:07 +0100 Subject: [PATCH] Rename if_in_black/whitelist to what they do --- discord_rss_bot/blacklist.py | 2 +- discord_rss_bot/feeds.py | 8 ++++---- discord_rss_bot/whitelist.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/discord_rss_bot/blacklist.py b/discord_rss_bot/blacklist.py index 351bcbd..73b4c4e 100644 --- a/discord_rss_bot/blacklist.py +++ b/discord_rss_bot/blacklist.py @@ -47,7 +47,7 @@ def has_black_tags(custom_reader: Reader, feed: Feed) -> bool: return True -def if_in_blacklist(custom_reader: Reader, entry: Entry) -> bool: +def should_be_skipped(custom_reader: Reader, entry: Entry) -> bool: """ Return True if the entry is in the blacklist. diff --git a/discord_rss_bot/feeds.py b/discord_rss_bot/feeds.py index 46d3b63..3336e5a 100644 --- a/discord_rss_bot/feeds.py +++ b/discord_rss_bot/feeds.py @@ -27,9 +27,9 @@ from discord_webhook import DiscordWebhook from reader import Entry, Reader, TagNotFoundError from requests import Response -from discord_rss_bot.blacklist import if_in_blacklist +from discord_rss_bot.blacklist import should_be_skipped from discord_rss_bot.settings import get_reader -from discord_rss_bot.whitelist import has_white_tags, if_in_whitelist +from discord_rss_bot.whitelist import has_white_tags, should_be_sent def send_to_discord(custom_reader: Reader | None = None, feed=None, do_once=False) -> None: @@ -74,8 +74,8 @@ def send_to_discord(custom_reader: Reader | None = None, feed=None, do_once=Fals webhook_message: str = f":robot: :mega: {entry.title}\n{entry.link}" webhook: DiscordWebhook = DiscordWebhook(url=webhook_url, content=webhook_message, rate_limit_retry=True) - blacklisted = if_in_blacklist(reader, entry) - whitelisted = if_in_whitelist(reader, entry) + blacklisted = should_be_skipped(reader, entry) + whitelisted = should_be_sent(reader, entry) if_whitelist_tags = has_white_tags(reader, feed) diff --git a/discord_rss_bot/whitelist.py b/discord_rss_bot/whitelist.py index 57f3ac8..fb89328 100644 --- a/discord_rss_bot/whitelist.py +++ b/discord_rss_bot/whitelist.py @@ -47,7 +47,7 @@ def has_white_tags(custom_reader: Reader, feed: Feed) -> bool: return True -def if_in_whitelist(custom_reader: Reader, entry: Entry) -> bool: +def should_be_sent(custom_reader: Reader, entry: Entry) -> bool: """ Return True if the entry is in the whitelist.