Split waste_schedule.py in two

This commit is contained in:
Edward Betts 2024-07-14 22:19:13 +08:00
parent 17eca6a95a
commit 0f3f596cb3
5 changed files with 107 additions and 93 deletions

View file

@ -15,6 +15,7 @@ import pytz
from . import (
accommodation,
birthday,
bristol_waste,
busy,
carnival,
conference,
@ -26,13 +27,13 @@ from . import (
hn,
holidays,
meetup,
n_somerset_waste,
stock_market,
subscription,
sun,
thespacedevs,
travel,
uk_holiday,
waste_schedule,
)
from .types import Event, StrDict
@ -62,9 +63,9 @@ async def waste_collection_events(
data_dir: str, postcode: str, uprn: str
) -> list[Event]:
"""Waste colllection events."""
html = await waste_schedule.get_html(data_dir, postcode, uprn)
html = await n_somerset_waste.get_html(data_dir, postcode, uprn)
root = lxml.html.fromstring(html)
events = waste_schedule.parse(root)
events = n_somerset_waste.parse(root)
return events
@ -72,7 +73,7 @@ async def bristol_waste_collection_events(
data_dir: str, start_date: date, uprn: str
) -> list[Event]:
"""Waste colllection events."""
return await waste_schedule.get_bristol_gov_uk(start_date, data_dir, uprn)
return await bristol_waste.get_bristol_gov_uk(start_date, data_dir, uprn)
def find_events_during_stay(