Compare commits
No commits in common. "943d45bd276cec45dda9fe83f4244c9ad5e22c93" and "13a959711d223c559ded6176a7a241e8bafe3286" have entirely different histories.
943d45bd27
...
13a959711d
|
@ -5,18 +5,15 @@ import os
|
||||||
import re
|
import re
|
||||||
import typing
|
import typing
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from datetime import date, datetime, timedelta, time
|
from datetime import date, datetime, timedelta
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
import lxml.html
|
import lxml.html
|
||||||
import pytz
|
|
||||||
|
|
||||||
from .types import Event
|
from .types import Event
|
||||||
|
|
||||||
ttl_hours = 12
|
ttl_hours = 12
|
||||||
|
|
||||||
uk_tz = pytz.timezone("Europe/London")
|
|
||||||
|
|
||||||
|
|
||||||
def make_waste_dir(data_dir: str) -> None:
|
def make_waste_dir(data_dir: str) -> None:
|
||||||
"""Make waste dir if missing."""
|
"""Make waste dir if missing."""
|
||||||
|
@ -94,11 +91,7 @@ def parse(root: lxml.html.HtmlElement) -> list[Event]:
|
||||||
by_date[following_date].append(service)
|
by_date[following_date].append(service)
|
||||||
|
|
||||||
return [
|
return [
|
||||||
Event(
|
Event(name="waste_schedule", date=d, title="Backwell: " + ", ".join(services))
|
||||||
name="waste_schedule",
|
|
||||||
date=uk_tz.localize(datetime.combine(d, time(6, 30))),
|
|
||||||
title="Backwell: " + ", ".join(services),
|
|
||||||
)
|
|
||||||
for d, services in by_date.items()
|
for d, services in by_date.items()
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue