python-caldav / caldav

Apache License 2.0
317 stars 94 forks source link

Basic example code - improve the code dealing with tasks #269

Open tobixen opened 1 year ago

tobixen commented 1 year ago

Ref #256, the example code covering tasks is a bit hidden and may be improved. See https://github.com/python-caldav/caldav/issues/256#issuecomment-1416494723 for details

vrii14 commented 1 year ago

Hi, I would like to work on this issue. Just wanted to check my understanding of what has to be done - Examples have to be added in the basic_usage_examples for new argument in complete method, uncomplete method, set_duration, get_due and set_due method. Is that correct?

tobixen commented 1 year ago

Yes. There is already a little bit of code at the bottom of search_calendar_demo, it should be moved out to a separate function (tasks_demo or something like that).

As for set_duration, get_due and set_due, I'm a bit hesitant if it should be in the examples, I'm not much happy with the API so it may change in version 2.0. At least it's needed with a warning. (the logic should be moved to the icalendar library, ref https://github.com/collective/icalendar/issues/496 - and the logic should also apply to events, not only tasks - but since events have DTEND instead of DUE, the current code cannot simply be moved up to the base class)

vrii14 commented 1 year ago

Okay I will work on this issue and then create a PR