Skip to content

Commit

Permalink
fix more flake8 errors
Browse files Browse the repository at this point in the history
Flake8 in pipenv seems to not work with the same config from the repo, this may be local setup issue, but needs to be investigated.
  • Loading branch information
fisher60 committed May 2, 2023
1 parent 0e03d31 commit 9ccacbd
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions bot/cogs/rss.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

class NotifyMember:
"""Class for storing RSS notification data."""

def __init__(self, search: str, member: discord.Member, channel: discord.TextChannel):
self.search_term: str = search
self.member: discord.Member = member
Expand All @@ -30,7 +31,8 @@ def __init__(self, search: str, member: discord.Member, channel: discord.TextCha


def data_to_ping_from_rss(search_term: str, feed_data: List[dict]) -> Optional[str]:
"""Return the first entry from RSS data feed to match a search term within the defined time window.
"""
Return the first entry from RSS data feed to match a search term within the defined time window.
Returns None if no matches were found between now and the notif_cooldown window.
"""
Expand Down Expand Up @@ -62,7 +64,7 @@ def cog_unload(self) -> None:
self.rss_background_task.cancel()

@tasks.loop(seconds=10.0)
async def rss_background_task(self):
async def rss_background_task(self) -> None:
"""Retrieve RSS data and notify appropriate members every 10 seconds."""
rss_data = feedparser.parse(await self.pull_rss_feed(RPI_RSS_FEED_URL))["entries"][:10]

Expand All @@ -75,7 +77,8 @@ async def rss_background_task(self):
await notif.notify_channel.send(f"{notif.member.mention}--{ping_member_data}")

async def pull_rss_feed(self, url: str) -> str:
"""Download the latest RSS feed with spoofed client headers.
"""
Download the latest RSS feed with spoofed client headers.
Headers should not need to be spoofed, but it seems the RPi locator CF settings are incorrect.
"""
Expand All @@ -87,7 +90,7 @@ async def pull_rss_feed(self, url: str) -> str:
aliases=("create_notification", "notification")
)
async def notify(self, ctx: Context, search_term: str, delete: bool = False) -> None:
"""Add a keyword to notify you on when it appears in the RSS feed"""
"""Add a keyword to notify you on when it appears in the RSS feed."""
if delete:
if ctx.author.id in notifications and search_term in notifications[ctx.author.id]:
del notifications[ctx.author.id][search_term]
Expand Down

0 comments on commit 9ccacbd

Please sign in to comment.