Validate YAML to check events

This commit is contained in:
Edward Betts 2024-04-05 11:23:29 +02:00
parent a607f29259
commit 5964899a00

View file

@ -2,8 +2,10 @@
"""Load YAML data to ensure validity.""" """Load YAML data to ensure validity."""
import os import os
from datetime import date, timedelta
import agenda.conference import agenda.conference
import agenda.data
import agenda.travel import agenda.travel
import agenda.trip import agenda.trip
@ -26,3 +28,10 @@ print(len(trains), "trains")
conferences = agenda.conference.get_list(os.path.join(data_dir, "conferences.yaml")) conferences = agenda.conference.get_list(os.path.join(data_dir, "conferences.yaml"))
print(len(conferences), "conferences") print(len(conferences), "conferences")
today = date.today()
last_year = today - timedelta(days=365)
next_year = today + timedelta(days=2 * 365)
events = agenda.data.read_events_yaml(data_dir, last_year, next_year)
print(len(events), "events")