Add configurable output folder
This commit is contained in:
parent
63f086651c
commit
2771d67f74
|
@ -2,3 +2,6 @@
|
||||||
city=Nürnberg
|
city=Nürnberg
|
||||||
street=Am Pointgraben
|
street=Am Pointgraben
|
||||||
house_number=7
|
house_number=7
|
||||||
|
|
||||||
|
[calendar]
|
||||||
|
target=/var/lib/radicale/collection/trash_dates
|
||||||
|
|
|
@ -65,15 +65,15 @@ radicale_props = {
|
||||||
"tag": "VCALENDAR"
|
"tag": "VCALENDAR"
|
||||||
}
|
}
|
||||||
|
|
||||||
processed_cals = os.path.join(".", "calendars")
|
target_path = config.get("calendar", "target", fallback=os.path.join(".", "calendars"))
|
||||||
if not os.path.exists(processed_cals):
|
if not os.path.exists(target_path):
|
||||||
os.makedirs(processed_cals)
|
os.makedirs(target_path)
|
||||||
|
|
||||||
for trash_type in trash_types:
|
for trash_type in trash_types:
|
||||||
radicale_props["D:displayname"] = trash_type.get("name")
|
radicale_props["D:displayname"] = trash_type.get("name")
|
||||||
radicale_props["ICAL:calendar-color"] = "#{}ff".format(trash_type.get("farbeRgb", "000000"))
|
radicale_props["ICAL:calendar-color"] = "#{}ff".format(trash_type.get("farbeRgb", "000000"))
|
||||||
folder_name = trash_type.get("name").replace("/", "_")
|
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):
|
if not os.path.exists(trash_type_folder):
|
||||||
os.makedirs(trash_type_folder)
|
os.makedirs(trash_type_folder)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue