parent
7d5cfe859a
commit
4ade643de6
|
@ -105,11 +105,10 @@ def dates_from_rrule(
|
|||
]
|
||||
|
||||
|
||||
async def waste_collection_events(data_dir: str) -> list[Event]:
|
||||
async def waste_collection_events(
|
||||
data_dir: str, postcode: str, uprn: str
|
||||
) -> list[Event]:
|
||||
"""Waste colllection events."""
|
||||
postcode = "BS48 3HG"
|
||||
uprn = "24071046"
|
||||
|
||||
html = await waste_schedule.get_html(data_dir, postcode, uprn)
|
||||
root = lxml.html.fromstring(html)
|
||||
events = waste_schedule.parse(root)
|
||||
|
@ -117,11 +116,9 @@ async def waste_collection_events(data_dir: str) -> list[Event]:
|
|||
|
||||
|
||||
async def bristol_waste_collection_events(
|
||||
data_dir: str, start_date: date
|
||||
data_dir: str, start_date: date, uprn: str
|
||||
) -> list[Event]:
|
||||
"""Waste colllection events."""
|
||||
uprn = "358335"
|
||||
|
||||
return await waste_schedule.get_bristol_gov_uk(start_date, data_dir, uprn)
|
||||
|
||||
|
||||
|
@ -375,8 +372,20 @@ async def get_data(
|
|||
t0 = time()
|
||||
result_list = await asyncio.gather(
|
||||
time_function("gwr_advance_tickets", gwr.advance_ticket_date, data_dir),
|
||||
time_function("backwell_bins", waste_collection_events, data_dir),
|
||||
time_function("bristol_bins", bristol_waste_collection_events, data_dir, today),
|
||||
time_function(
|
||||
"backwell_bins",
|
||||
waste_collection_events,
|
||||
data_dir,
|
||||
config["BACKWELL_POSTCODE"],
|
||||
config["BACKWELL_UPRN"],
|
||||
),
|
||||
time_function(
|
||||
"bristol_bins",
|
||||
bristol_waste_collection_events,
|
||||
data_dir,
|
||||
today,
|
||||
config["BRISTOL_UPRN"],
|
||||
),
|
||||
)
|
||||
rockets = thespacedevs.read_cached_launches(rocket_dir)
|
||||
|
||||
|
|
|
@ -14,10 +14,8 @@ config = __import__("config.default", fromlist=[""])
|
|||
|
||||
async def bristol_waste_collection_events() -> list[agenda.types.Event]:
|
||||
"""Waste colllection events."""
|
||||
uprn = "358335"
|
||||
|
||||
return await agenda.waste_schedule.get_bristol_gov_uk(
|
||||
date.today(), config.DATA_DIR, uprn, refresh=True
|
||||
date.today(), config.DATA_DIR, config.BRISTOL_UPRN, refresh=True
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue