Closed VinzenzStauner closed 5 months ago
For the purpose above, I think you should rather access task.data
rather than task.icalendar_component
. I also think the documentation for how to access task.icalendar_component.categories
belongs to the icalendar library and not to the caldav library.
Hi there, I found this labrary very useful as I am currently writing a client app for Caldav and Webdav data. Really great work!
I had an issue how to read the vCATEGORY object using the follwoing code. It would be very useful to show the tweak how to convert ical objects to a string representation using to_ical().decode() in the documentation or example code. Would that be possible?
Here the code snippet:
It always returned a vCATEGORY object instead of a string representation:
CATEGORIES: <icalendar.prop.vCategory object at 0x7fdf49131e10>
Solution: the line where I read the categories must be changed to the following code using the to_ical().decode() functions:
print(item + ": " + str(task.icalendar_component[item].to_ical().decode()))
With that tweak, the categories where printed fine like this:
CATEGORIES: Test