tobixen / plann

Command-line interface to calendars
GNU General Public License v3.0
40 stars 2 forks source link

TypeError: DAVClient.__init__() missing 1 required positional argument: 'url' #11

Open bergercookie opened 1 month ago

bergercookie commented 1 month ago

Hi there @tobixen ,

Many thanks for open-sourcing this work! It looks really useful and FYI, I'm trying to use it to do some e2e testing of the Taskwarrior <> Caldav integration in syncall :-)

Aftrer a fresh install either from pypi or using pip install git+https://github.com/tobixen/plann/issues/new, and after running a command like the following, I'm getting an error regarding the url positional argument:

plann --caldav-user XXX --caldav-password YYY --calendar-url http://localhost:5232/berger/5e3c1800-5bba-11ef-9ab9-ebd9c3170386/   --calendar-name test_tasks  --raise-errors list-calendars
  File "/home/berger/.cache/pypoetry/virtualenvs/plann/lib/python3.10/site-packages/plann/lib.py", line 248, in find_calendars
    client = caldav.DAVClient(**conn_params)
TypeError: DAVClient.__init__() missing 1 required positional argument: 'url'

I think the issue is that DAVClient requires a url parameter while we're attempting to pass one named caldav_url. Something like this seems to help me get past that error:

       calendars = []
    url = conn_params.pop('caldav_url', None)
    if conn_params:
        client = caldav.DAVClient(url=url, **conn_params)
tobixen commented 1 month ago

Thanks for the report! Would you care writing up a pull request on this one?

I expect to do a release the upcoming week or next, it's long overdue!