Conference CFP end dates as events

Closes: #122
This commit is contained in:
Edward Betts 2024-01-22 13:04:08 +00:00
parent f028e40df8
commit b7d655a21e

View file

@ -48,8 +48,9 @@ class Conference:
def get_list(filepath: str) -> list[Event]:
"""Read conferences from a YAML file and return a list of Event objects."""
return [
Event(
events: list[Event] = []
for conf in (Conference(**conf) for conf in yaml.safe_load(open(filepath, "r"))):
event = Event(
name="conference",
date=conf.start,
end_date=conf.end,
@ -57,5 +58,15 @@ def get_list(filepath: str) -> list[Event]:
url=conf.url,
going=conf.going,
)
for conf in (Conference(**conf) for conf in yaml.safe_load(open(filepath, "r")))
]
events.append(event)
if not conf.cfp_end:
continue
cfp_end_event = Event(
name="cfp_end",
date=conf.cfp_end,
title="CFP end: " + conf.display_name,
url=conf.cfp_url or conf.url,
)
events.append(cfp_end_event)
return events