remove backwards compatibility
1 file changed, 2 insertions(+), 12 deletions(-)
changed files
M mycal.py → mycal.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)