diff --git a/fabcal/calendar_client.py b/fabcal/calendar_client.py index b8d7d63..cde581e 100644 --- a/fabcal/calendar_client.py +++ b/fabcal/calendar_client.py @@ -21,6 +21,9 @@ class ConfiguredCalendar(NamedTuple): name: str url: str default_color: str = None + overwrite_summary: str = None + overwrite_description: str = None + overwrite_location: str = None class CalendarClient: @@ -84,6 +87,11 @@ class CombinedCalendarClient: except KeyError: default_color = None + # if the user wishes to overwrite some data on every item in a calendar, we should do so + overwrite_summary = configured_calendar.overwrite_summary + overwrite_description = configured_calendar.overwrite_description + overwrite_location = configured_calendar.overwrite_location + # we don't copy anything but events from the for event in cal.walk("VEVENT"): # if no color has been configured in the event, we @@ -91,6 +99,15 @@ class CombinedCalendarClient: if "color" not in event: event["color"] = default_color + if overwrite_summary: + event["SUMMARY"] = overwrite_summary + + if overwrite_description: + event["DESCRIPTION"] = overwrite_description + + if overwrite_location: + event["LOCATION"] = overwrite_location + combined_calendar.add_component(event) return combined_calendar