Split 'class Event' into its own file

This commit is contained in:
Edward Betts 2024-10-01 11:13:39 +01:00
parent 02fd6dbbe6
commit a324046332
20 changed files with 174 additions and 164 deletions

View file

@ -6,7 +6,8 @@ from datetime import date, timedelta
import agenda.uk_holiday
import holidays
from .types import Event, Holiday
from .event import Event
from .types import Holiday
def us_holidays(start_date: date, end_date: date) -> list[Holiday]:
@ -98,9 +99,9 @@ def combine_holidays(holidays: list[Holiday]) -> list[Event]:
(12, 26): "Boxing Day",
}
combined: collections.defaultdict[
tuple[date, str], set[str]
] = collections.defaultdict(set)
combined: collections.defaultdict[tuple[date, str], set[str]] = (
collections.defaultdict(set)
)
for h in holidays:
assert isinstance(h.name, str) and isinstance(h.date, date)