diff --git a/config.ini.example b/config.ini.example index 5a5e27e..56893d8 100644 --- a/config.ini.example +++ b/config.ini.example @@ -2,3 +2,6 @@ city=Nürnberg street=Am Pointgraben house_number=7 + +[calendar] +target=/var/lib/radicale/collection/trash_dates diff --git a/generate_ical.py b/generate_ical.py index ea256e5..c61a024 100644 --- a/generate_ical.py +++ b/generate_ical.py @@ -65,15 +65,15 @@ radicale_props = { "tag": "VCALENDAR" } -processed_cals = os.path.join(".", "calendars") -if not os.path.exists(processed_cals): - os.makedirs(processed_cals) +target_path = config.get("calendar", "target", fallback=os.path.join(".", "calendars")) +if not os.path.exists(target_path): + os.makedirs(target_path) for trash_type in trash_types: radicale_props["D:displayname"] = trash_type.get("name") radicale_props["ICAL:calendar-color"] = "#{}ff".format(trash_type.get("farbeRgb", "000000")) folder_name = trash_type.get("name").replace("/", "_") - trash_type_folder = os.path.join(processed_cals, folder_name) + trash_type_folder = os.path.join(target_path, folder_name) if not os.path.exists(trash_type_folder): os.makedirs(trash_type_folder)