all repos — mycal @ 0e13c16fb8006abd463c59579ff3aac3384d2a4c

private calendar anonymiser

remove backwards compatibility

Alan Pearce
commit

0e13c16fb8006abd463c59579ff3aac3384d2a4c

parent

10527ff359e804c9706b0c16f6176ad1f1a9e858

1 file changed, 2 insertions(+), 12 deletions(-)

changed files
M mycal.pymycal.py
@@ -24,8 +24,7 @@ class Config(TomlDataClassIO):
name: str email: str timezone: str - calendar: typing.Optional[CalendarConfig] = None # Keep for backward compatibility - calendars: typing.List[CalendarConfig] = field(default_factory=list) # New field for multiple calendars + calendars: typing.List[CalendarConfig] = field(default_factory=list) def load_config(file_path): with open(file_path, "r") as fr:
@@ -125,18 +124,9 @@ busy.add('dtstart', start_date.astimezone(tz=utc))
busy.add('dtend', end_date.astimezone(tz=utc)) try: - calendars_to_process = [] busy_periods = {} - # For backward compatibility - if config.calendar is not None and (config.calendar['file'] != "" or config.calendar['url'] != ""): - calendars_to_process.append(config.calendar) - - # Add calendars from the new field if available - if config.calendars: - calendars_to_process.extend(config.calendars) - - for calendar_config in calendars_to_process: + for calendar_config in config.calendars: calendar_data = get_calendar(calendar_config) input_calendar = Calendar.from_ical(calendar_data)