Skip to content

Commit

Permalink
MT: fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
jessemortenson committed Dec 9, 2024
1 parent 25c6cc1 commit a6da86e
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions scrapers/mt/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ def scrape(self):
# scrape events from this month, and last month
today = datetime.date.today()
self.scrape_cal_month(today)
self.scrape_cal_month(
today + dateutil.relativedelta.relativedelta(months=-1)
)
self.scrape_cal_month(today + dateutil.relativedelta.relativedelta(months=-1))
for event in self._events:
yield event

Expand Down Expand Up @@ -105,9 +103,15 @@ def scrape_event(self, url: str):
if existing_event is None:
self._events.append(event)

def check_for_existing_event(self, title: str, location_name: str, start_date: datetime.datetime.date) -> Union[Event, None]:
def check_for_existing_event(
self, title: str, location_name: str, start_date: datetime.datetime.date
) -> Union[Event, None]:
for event in self._events:
if event.name == title and event.location["name"] == location_name and event.start_date == start_date:
if (
event.name == title
and event.location["name"] == location_name
and event.start_date == start_date
):
return event

return None
Expand All @@ -133,5 +137,5 @@ def scrape_media(self, event: Event, html: str):
m["textTags"]["DESCRIPTION"]["text"],
m["textTags"]["URL"]["text"],
media_type="application/vnd",
on_duplicate="ignore" # we are combining links from duplicate "event" listings into one
on_duplicate="ignore", # we are combining links from duplicate "event" listings into one
)

0 comments on commit a6da86e

Please sign in to comment.