diff --git a/agenda/conference.py b/agenda/conference.py index 50b0b35..24ed552 100644 --- a/agenda/conference.py +++ b/agenda/conference.py @@ -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