Git Product home page Git Product logo

calendar-cli's Introduction

calendar-cli

Simple command-line CalDAV client, making it possible to add calendar events, browse an agenda and do task management using a caldav server.

THIS IS THE LEGACY VERSION. If you're already using calendar-cli and don't want to change anything, then keep using it. If you need a production-ready mature command-line utility for accessing your calendar, then this is the right tool ... as for now. I decided to change a bit on the user interface, rather than breaking backward compatibility I made a new command name plann. I would recommend visit https://github.com/tobixen/plann for the new version.

calendar-cli will be maintained primarily for backward compatibility. Pull-requests dealing with bugfixes or minor "missing" features will be considered - but for anyone in need of a command-line interface towards a CalDAV calendar server, the recommendation is to use plann instead.

Other tools

There is another project out there, "Command-line Interface for Google Calendar", previously located at pypi under the calendar-cli name. It has now been renamed to gcalendar-cli to avoid name conflict, and is available at https://pypi.python.org/pypi/gcalendar-cli/

There is a "competing" project at https://github.com/geier/khal - you may want to check it out - it's more mature but probably more complex. It's using a "vsyncdir" backend - if I've understood it correctly, that involves building a local copy of the calendar. The philosophy behind calendar-cli is slightly different, calendar-cli is supposed to be a simple cli-based caldav+ical client. No synchronization, no local storage, just client-side operations.

Usage examples

The commands and options will be described further down, however examples often beat documentation.

First, check the tests folder - the file tests.sh shows some basic usage examples. If you have radicale installed (sudo pip install radicale), you can try executing test_calendar-cli.sh in the test folder, it basically sets up a temporary radicale server and executes the tests.sh towards that server. If test_calendar-cli.sh breaks then please raise an issue on the github or try to reach out through other channels.

In the examples folder there is a script I was using on a regular basis for task management for a while.

Installation

calendar-cli depends on quite some python libraries, i.e. pytz, caldav, etc. "sudo ./setup.py install" should take care of all those eventually, and will also make an executable under /usr/bin

Support

#calendar-cli at irc.oftc.net, eventually [email protected], eventually the issue tracker at https://github.com/tobixen/calendar-cli/issues

Before reaching out, please make sure all the dependencies are installed and that you've installed the latest version of the caldav python library.

Rationale

GUIs and Web-UIs are nice for some purposes, but I really find the command line unbeatable when it comes to:

  • Minor stuff that is repeated often. Writing something like "todo add make a calendar-cli system" or "calendar add 'tomorrow 15:40+2h' doctor appointment" is (for me) faster than navigating into some web calendar interface and add an item there.
  • Things that are outside the scope of the UI. Here is one of many tasks I'd like to do: "go through the work calendar, find all new calendar events that are outside office hours, check up with the personal calendar if there are potential conflicts, add some information at the personal calendar if appropriate", and vice versa - it has to be handled very manually if doing it through any normal calendar application as far as I know, but if having some simple CLI or python library I could easily make some interactive script that would help me doing the operation above.

When I started writing calendar-cli, all I could find was cadaver and the CalDAVClientLibrary. Both of those seems to be a bit shortcoming; they seem to miss the iCalendar parsing/generation, and there are things that simply cannot be done through those tools.

Synopsis

calendar-cli.py [global options] [command] [command options] [subcommand] [subcommand options] [subcommand arguments] ...

I'm intending to make it easier by allowing calendar-cli.py to be symlinked to the various commands and also to allow the options to be placed wherever.

Global options

Only long options will be available in the early versions; I don't want to pollute the short option space before the CLI is reasonably well-defined.

Always consult --help for up-to-date and complete listings of options. The list below will only contain the most important options and may not be up-to-date and may contain features not implemented yet.

  • --interactive: stop and query the user rather often
  • --caldav-url, --caldav-user, --caldav-pass: how to connect to the CalDAV server. Fits better into a configuration file.
  • --calendar-url: url to the calendar one wants to use. A relative URL (path) or a calendar-id is also accepted.
  • --config-file: use a specific configuration file (default: $HOME/.config/calendar.conf)
  • --config-section: use a specific section from the config file (i.e. to select a different caldav-server to connect to)
  • --icalendar: Write or read icalendar to/from stdout/stdin
  • --nocaldav: don't connect to a caldav server
  • --timezone: any "naive" timestamp should be considered to belong to the given time zone, timestamps outputted should be in this time zone, timestamps given through options should be considered to be in this time zone (Olson database identifiers, like UTC or Europe/Helsinki). (default: local timezone)

The caldav URL is supposed to be something like i.e. http://some.davical.server/caldav.php/ - it is only supposed to relay the server location, not the user or calendar. Things will most likely work if you give http://some.davical.server/caldav.php/tobixen/work-calendar/ - but it will ignore the calendar part of it, and use first calendar it can find - which perhaps may be tobixen/family-calendar/. Use http://some.davical.server/caldav.php/ as the caldav URL, and /tobixen/family-calendar as the calendar-url.

Commands

As of 0.12, there are two or three distinct commands - calendar (for management of events) and todo (for task management), with quite different code paths. The third thing is journal ... but as far as I know, it's not much common to use caldav servers for keeping journals, the journal thing is not much tested nor much rich on features.

There will be code refactorings in v1.0, applying quite some of the logic in the task management to the calendar management.

  • calendar - access/modify a calendar
    • subcommands: add, addics (for uploading events in ical format), agenda, delete, create (for creating a new calendar)
  • todo - access/modify a todo-list
    • subcommands: add, list, edit, postpone, complete, delete, addlist

todo addlist: for creating a new task list. Most caldav servers don't make any difference between a task list and a calendar. Zimbra is an exception. addlist hasn't been tested as of version 0.12, perhaps it works, perhaps not)

Event time specification

Supported in v0.12:

  • anything recognized by dateutil.parser.parse()
  • An iso time stamp, followed with the duration, using either + or space as separator. Duration is a number postfixed by s for seconds, m for minutes, h for hours, d for days, w for weeks and y for years (i.e. 2013-09-10T13:37+30d)
  • ISO dates. For full day events, make sure to specify the duration in days.

Getting out customized information through --todo-template and --event-template

This is a string containing variables enclosed in curly braces, like "uid: {uid}".

Particularly the uid can be useful, as one may want to use the uid for things like deleting events and postponing tasks.

In the examples folder there is a task management script which will use the --todo-template to create a new shell script for postponing all overdue tasks. This shell script can then be edited interactively and run.

Task management

With the todo-command, there are quite some options available (i.e. --categories, --limit, --todo-uid, etc) to select or filter tasks. Those are used by the commands list, edit, postpone, complete and delete. A typical use-case scenario is to first use the "list" command, tweak the filtering options to get a list containing the tasks one wants to operate with, and then use either edit, postpone, complete or delete.

The file TASK_MANAGEMENT.md contains some thoughts on how to organize tasks.

Configuration file

Configuration file is by default located in $HOME/.config/calendar.conf. You may run calendar-cli --interactive-config if you don't feel comfortable with hand-crafting configuration in json syntax, though this feature is not tested regularly.

(I considered .ini, but I was told that it's actually not a standard. I'd like any calendar application to be able to access the file, hence calendar.conf and not calendar-cli.conf)

calendar-cli

The file may look like this:

{ "default":
  { "caldav_url": "http://foo.bar.example.com/caldav/",
    "caldav_user": "luser",
    "caldav_pass": "insecure"
  }
}

A configuration with multiple sections may look like this:

{
"default":
  { "caldav_url": "http://foo.bar.example.com/caldav/",
    "caldav_user": "luser",
    "caldav_pass": "insecure"
  },
"baz":
  { "caldav_url": "http://foo.baz.example.com/caldav/",
    "caldav_user": "luser2",
    "caldav_pass": "insecure2"
  }
}

Sections may also include calendar urls or ids, and sections may inherit other sections:

{
"default":
  { "caldav_url": "http://foo.bar.example.com/caldav/",
    "caldav_user": "luser",
    "caldav_pass": "insecure"
  },
"baz":
  { "caldav_url": "http://foo.baz.example.com/caldav/",
    "caldav_user": "luser2",
    "caldav_pass": "insecure2"
  }
},
"bazimportant":
  { "inherits": "baz",
    "calendar_url": "important"
  }

Usage example

Add a calendar item "testevent" at 2013-10-01:

./calendar-cli.py --calendar-url=http://calendar.bekkenstenveien53c.oslo.no/caldav.php/tobias/calendar/ calendar add 2013-10-01 testevent

(assumes that caldav-url, caldav-pass and caldav-user has been added into configuration file. Those may also be added as command line options)

Objectives

  • It should be really easy and quick to add a todo-list item from the command line.
  • It should be really easy and quick to add a calendar item from the command line.
  • It should be possible to get out lists ("agenda") of calendar items and todo-items.
  • Interface for copying calendar items between calendars, even between calendars on distinct caldav servers

Roadmap

calendar-cli will be maintained with bugfixes and security fixes, on requests from the community. The maintainer is no longer using calendar-cli.

A new project https://github.com/tobixen/plann with a new interface has been forked off.

calendar-cli's People

Contributors

bug avatar dotlambda avatar fauxmight avatar fgtham avatar mkapra avatar phavekes avatar tobixen avatar ymitsos avatar zepalmer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

calendar-cli's Issues

missing dependency on requests

something's weird after a pip install --upgrade 'git+https://github.com/tobixen/calendar-cli#egg=calendar-cli':

>./bin/calendar-cli.py  -h
Traceback (most recent call last):
  File "./bin/calendar-cli.py", line 12, in <module>
    import caldav
  File "/tmp/radicale/local/lib/python2.7/site-packages/caldav/__init__.py", line 3, in <module>
    from .davclient import DAVClient
  File "/tmp/radicale/local/lib/python2.7/site-packages/caldav/davclient.py", line 4, in <module>
    import requests
ImportError: No module named requests

I have the feeling it's not necessarily calendar-cli's fault, so the bug might need to be propagated.
In any case, the ".py" suffix could be gotten rid of...

cannot connect to the radicale calendar

Hi,

after installing i have problem to connect to the my own radicale calendar server (served via Nginx -> uWSGI -> Radicale), which i am using for some years with vdirsyncer and thunderbird + lightning:

Traceback (most recent call last):
  File "/usr/lib64/python3.4/site-packages/calendar_cli-0.0.0-py3.4.egg/EGG-INFO/scripts/calendar-cli.py", line 392, in todo_select
  File "/usr/lib64/python3.4/site-packages/calendar_cli-0.0.0-py3.4.egg/EGG-INFO/scripts/calendar-cli.py", line 84, in find_calendar
  File "/usr/lib64/python3.4/site-packages/caldav-0.4.0-py3.4.egg/caldav/objects.py", line 307, in __init__
    cup = self.get_properties([dav.CurrentUserPrincipal()])
  File "/usr/lib64/python3.4/site-packages/caldav-0.4.0-py3.4.egg/caldav/objects.py", line 172, in get_properties
    response = self._query_properties(props, depth)
  File "/usr/lib64/python3.4/site-packages/caldav-0.4.0-py3.4.egg/caldav/objects.py", line 99, in _query_properties
    return self._query(root, depth)
  File "/usr/lib64/python3.4/site-packages/caldav-0.4.0-py3.4.egg/caldav/objects.py", line 114, in _query
    url, body, depth)
  File "/usr/lib64/python3.4/site-packages/caldav-0.4.0-py3.4.egg/caldav/davclient.py", line 127, in propfind
    return self.request(url or self.url, "PROPFIND", props, {'Depth': str(depth)})
  File "/usr/lib64/python3.4/site-packages/caldav-0.4.0-py3.4.egg/caldav/davclient.py", line 242, in request
    raise ex
caldav.lib.error.AuthorizationError: AuthorizationError at 'https://calend.slavino.sk/slavko/hlavny.ics/', reason 'Unauthorized'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/calendar-cli.py", line 4, in <module>
    __import__('pkg_resources').run_script('calendar-cli==0.0.0', 'calendar-cli.py')
  File "/usr/lib64/python3.4/site-packages/pkg_resources/__init__.py", line 726, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib64/python3.4/site-packages/pkg_resources/__init__.py", line 1491, in run_script
    exec(script_code, namespace, namespace)
  File "/usr/lib64/python3.4/site-packages/calendar_cli-0.0.0-py3.4.egg/EGG-INFO/scripts/calendar-cli.py", line 687, in <module>
  File "/usr/lib64/python3.4/site-packages/calendar_cli-0.0.0-py3.4.egg/EGG-INFO/scripts/calendar-cli.py", line 684, in main
  File "/usr/lib64/python3.4/site-packages/calendar_cli-0.0.0-py3.4.egg/EGG-INFO/scripts/calendar-cli.py", line 475, in todo_list
  File "/usr/lib64/python3.4/site-packages/calendar_cli-0.0.0-py3.4.egg/EGG-INFO/scripts/calendar-cli.py", line 394, in todo_select
  File "/usr/lib64/python3.4/site-packages/calendar_cli-0.0.0-py3.4.egg/EGG-INFO/scripts/calendar-cli.py", line 84, in find_calendar
  File "/usr/lib64/python3.4/site-packages/caldav-0.4.0-py3.4.egg/caldav/objects.py", line 307, in __init__
    cup = self.get_properties([dav.CurrentUserPrincipal()])
  File "/usr/lib64/python3.4/site-packages/caldav-0.4.0-py3.4.egg/caldav/objects.py", line 172, in get_properties
    response = self._query_properties(props, depth)
  File "/usr/lib64/python3.4/site-packages/caldav-0.4.0-py3.4.egg/caldav/objects.py", line 99, in _query_properties
    return self._query(root, depth)
  File "/usr/lib64/python3.4/site-packages/caldav-0.4.0-py3.4.egg/caldav/objects.py", line 114, in _query
    url, body, depth)
  File "/usr/lib64/python3.4/site-packages/caldav-0.4.0-py3.4.egg/caldav/davclient.py", line 127, in propfind
    return self.request(url or self.url, "PROPFIND", props, {'Depth': str(depth)})
  File "/usr/lib64/python3.4/site-packages/caldav-0.4.0-py3.4.egg/caldav/davclient.py", line 242, in request
    raise ex
caldav.lib.error.AuthorizationError: AuthorizationError at 'https://calend.slavino.sk/slavko/hlavny.ics/', reason 'Unauthorized'

The connection is forced to https and the TLS handshake seems to be completed (i am not expert, but i see no problem in wireshark). I have HTTP Basic auth in nginx, which works with vdirsyncer (from nginx's log):

192.168.0.1 - name [04/Apr/2016:20:00:01 +0200] "PROPFIND /name/calendar.ics/ HTTP/1.1" 207 6243 "-" "vdirsyncer"

but doesn't work with calendar-cli (always two requests by one command):

192.168.0.1 - - [04/Apr/2016:20:32:07 +0200] "PROPFIND /name/calendar.ics/ HTTP/1.1" 401 0 "-" "Mozilla/5.0"
192.168.0.1 - - [04/Apr/2016:20:32:07 +0200] "PROPFIND /name/calendar.ics/ HTTP/1.1" 401 0 "-" "Mozilla/5.0"

I am not able to debug the HTTP due TLS...

The config file contains (name and password removed):

{ "default": 
    { "caldav_url": "https://myserver.name/name/calendar.ics/",
        "caldav-user": "name",
        "caldav-pass": "passwd"
    }
}

The credentials are OK, because i copy them from vdirsyncer's config and then retype them again. My knowledge ends here :-(

calendar-cli on PyPi

There is a calendar-cli on the PyPi, it seems as related (gcalendar), but not the same apps and this can be confusing for the users (include me, for while). IMO will be good at least to mention it in README, to prevent confusing, or ,if you are willing, to rename the project.

ImportError: No module named tzlocal

When I try to start calendar-cli on Linux Mint 17 Qiana, I get the error "ImportError: No module named tzlocal".
I can fix this with "sudo pip install tzlocal", but I think the error should not happen at all.
Having fixed the error, I run into the next error "ImportError: No module named icalendar".
I can fix that with "sudo pip install icalendar", but most people would probably have given up there already. Having fixed that error, I run into the next error "ImportError: No module named caldav", which makes me think about trying khal instead. I was able to fix the error with "sudo pip install caldav", though.

Sabre exception when querying Owncloud calendar

I'm trying to read a calendar from a local server running Owncloud. The client system is Xubuntu 15.10, the server is Ubuntu 14.04 with Owncloud 8.1.4. I assume that's what the 'agenda' subcommand is supposed to do.

$ ./calendar-cli.py calendar agenda
Traceback (most recent call last):
  File "./calendar-cli.py", line 665, in <module>
    main()
  File "./calendar-cli.py", line 662, in main
    ret = args.func(caldav_conn, args)
  File "./calendar-cli.py", line 328, in calendar_agenda
    events_ = find_calendar(caldav_conn, args).date_search(dtstart, dtend)
  File "/usr/local/lib/python2.7/dist-packages/caldav/objects.py", line 491, in date_search
    response = self._query(root, 1, 'report')
  File "/usr/local/lib/python2.7/dist-packages/caldav/objects.py", line 120, in _query
    raise error.exception_by_method[query_method](ret.raw)
caldav.lib.error.ReportError: <?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:sabredav-version>2.1.6</s:sabredav-version>
  <s:exception>Sabre\VObject\EofException</s:exception>
  <s:message>End of document reached prematurely</s:message>
</d:error>

Printing the todo list seems to work:

 ./calendar-cli.py todo list
2015-11-05! 2016-11-04  Test 1 2 3 4

Adding items to the calendar also works. It's just the reading that doesn't work.

I am not sure what to make of this. Other CalDAV clients like the CalDAV sync adapter for Android or Mozilla Thunderbird with the Lightning plugin work just fine.

Feature: allow "displaced" options

With subcommands and subsubcommands all taking slightly different options, there is bound to be confusion on where the options should go. There must be some way to parse displaced options.

URL method is encoding % character from find_calendar_url

I'm trying to run this against davmail but ran into a 503 error. turning on debug showed me this output after trying to PUT the ics:

ErrorNonExistentMailbox The SMTP address has no mailbox associated with it.

Taking a closer look and it seems to be the URL being put has had the % of the %40 (@) symbol encoded again resulting in something like this:

url from find_calendar_url():

/users/ianmorti%40cisco.com/calendar/AAMkADY5Yzk2YzY2LTM3YjgtNGU3MS04ZjJhLWE0OTA5OTA2YzMzMABGAAAAAABaZbS1qzoCRbWKnukDytwmBwAAfSH2WrdKSZ6O8gsQ94_mAAAAIktDAAAlhWHjXhoFTaJrSjqq9TpRAAAPvJBbAAA%3D.EML/

url after passing through URL() from caldavclientlibrary in _calendar_addics():
URL: /users/ianmorti%2540cisco.com/calendar/AAMkADY5Yzk2YzY2LTM3YjgtNGU3MS04ZjJhLWE0OTA5OTA2YzMzMABGAAAAAABaZbS1qzoCRbWKnukDytwmBwAAfSH2WrdKSZ6O8gsQ94_mAAAAIktDAAAlhWHjXhoFTaJrSjqq9TpRAAAPvJBbAAA%253D.EML/1049a928-5d33-11e3-bbfd-90b11c66433d.ics

note the %2540 in my email address.

python3: byte-objects are printed to stdout

Also ref #33

When calendar-cli is run with python3 rather than python2, the printout from calendar todo list looks quite bad now ... like b'description of task' instead of just description of task.

List iCloud todo fails

I just noticed that listing my iCloud's todo list fails with the following error:

$ ./calendar-cli.py —config-section shopping list todo list
Traceback (most recent call last):
  File "/Users/manfred/src/calendar-cli/calendar-cli.py", line 798, in <module>
    main()
  File "/Users/manfred/src/calendar-cli/calendar-cli.py", line 795, in main
    ret = args.func(caldav_conn, args)
  File "/Users/manfred/src/calendar-cli/calendar-cli.py", line 533, in todo_list
    tasks = todo_select(caldav_conn, args)
  File "/Users/manfred/src/calendar-cli/calendar-cli.py", line 430, in todo_select
    tasks = find_calendar(caldav_conn, args).todos()
  File "/usr/local/lib/python2.7/site-packages/caldav/objects.py", line 551, in todos
    response = self._query(root, 1, 'report')
  File "/usr/local/lib/python2.7/site-packages/caldav/objects.py", line 123, in _query
    raise error.exception_by_method[query_method](errmsg(ret))
caldav.lib.error.ReportError: 500 Internal Server Error

Adding items to the same list works fine, though:

$ ./calendar-cli.py --config-section shoppinglist todo add Tomatoes
Added todo item with uid=57a031c2-865b-11e5-8b6b-14109ff07266

--event-template is poorly documented and tested

Sorry I use a translator (Deepl.com)

hello,
First of all, thanks for calendar-cli, it's really great.
I would like to know if there would be (or if there is already) the possibility to add a description and the place to the agenda?
I use descriptions a lot in calendar events and that would be really useful for me.
Thanks in advance for your help.

Select todo ID for editing

Hi,
very interesting project.

I need little help.
How can I get the ID or what is necessary of a specific todo item to edit this one?

Feature: semi-automatic calendar synchronization

Purpose: sync relevant events i.e. between private and work calendars.

I.e. syncing from the work calendar to private calender:

  • One sets up a filter (i.e. monday-friday, 09-17 - plus a fuzz-factor of one hour - so everything between 16:00 and 10:00 should be listed out when syncing to the private calendar, and everything between 08:00 and 18:00 should be listed when syncing the other way).

  • All events outside the time filter should be listed out from the work calendar

  • All of those events that are already referred from the private calendar should be excluded

  • Remaining events gets listed in a temp text file. Every line is prefixed with "A" for add.

  • calendar-cli opens $EDITOR and allows the user to edit the temp text file

  • file contains user instructions

  • user deletes stuff that shouldn't be synced (or better: mark it up, so the next sync won't ask for it)

  • some stuff should be synced, but without confidential details. system should allow for this.

  • events are stuffed into the private calendar.

  • user may do the reverse for syncing from the private calendar to the work calendar.

    or outside (vice-verse) the time interval (plus/minus some margins - say one hour overlapping) will be listed out. The into a text file.

Delete by date

Hi,
I haven't found how delete an event. At the end of your code, I found arguments --event-uid, -url and -timestamp. I try uid and it works fine. But, with -timestamp, not. Is there a little documentation for the format of timestamp or is it evident ? It's certainly not a criticism, just a question.
Thank you. Vincent
(My english is poor. In frech, I know that words are important to say I only search to use a work I appreciate, but in english, i don't know how to say that.)

Date_search expand

Hi,
Excuse-me for my bad english. Thank you very much for your soft which is exactly I search.
I had a problem when I tried the following line : calendar-cli.py calendar agenda --from-time=2016-05-17 --agenda-days=14.
Error was :
File "/usr/local/bin/calendarcmd", line 480, in calendar_agenda events_ = find_calendar(caldav_conn, args).date_search(dtstart, dtend, expand=True) TypeError: date_search() got an unexpected keyword argument 'expand'
I removed ", expand=True" at line 480 and the error disappeared and all worked out.
But, is it correct to do so ?
Thank you again for your work. Have a nice day. Vincent

date_search() got an unexpected keyword argument 'expand'

Topic:

Traceback (most recent call last):
  File "calendar-cli.py", line 937, in <module>
    main()
  File "calendar-cli.py", line 934, in main
    ret = args.func(caldav_conn, args)
  File "calendar-cli.py", line 480, in calendar_agenda
    events_ = find_calendar(caldav_conn, args).date_search(dtstart, dtend, expand=True)
TypeError: date_search() got an unexpected keyword argument 'expand'

anything else I can provide? Python 2.7.17.

Add reminder to event

Hi, and thanks for this nice little tool. Very Handy to use inside scripts to automatically add events !

There is one killer feature that I miss very much: the possibility to add a reminder to the event. Have I missed this one ?

Kolab Now not working

I wanted to try out calendar-cli, which looks very promising. Yet I cannot get it to work with my CalDav calendars in Kolab Now. I use them successfully with DavDroid, Evolution and Thunderbird, so I think this ought to work as well.

Kolab has a variety of endpoints to use, as also documented: https://kolabnow.com/clients/others#carddav-and-caldav-settings

  • https://apps.kolabnow.com
  • https://apps.kolabnow.com/calendars
  • https://apps.kolabnow.com/calendars/<account_mail_address>
  • https://apps.kolabnow.com/calendars/<account_mail_address>/<unique_id_per_calendar>

When I try to connect, I get returned an error: Exception: The CalDAV server you are using has a problem with path handling.
If I fail to provide a password I get a caldav.lib.error.AuthorizationError: ... reason 'Unauthorized' error, so it seems it is failing at some of the latter stages.
I tried both the calendar and task lists.

I could not easily search in the bitbucket code of the underlying library. Is that the one I should be looking into to resolve this issue? Are there ways in which I can debug this issue?

Due dates and duration

This is a follow-up of #63, to be fixed "properly" in some upcoming 1.0-release, possibly with some work-arounds in 0.12 or 0.13.

As of 0.11, todo items with no due date set will be shown with a due date (calcualated out from a hard coded default duration). If no due date is given when creating a vtodo item, the due date is set through a hard-coded default duration. Further, handling of the DURATION field in the vtodo when listing tasks is probably broken.

While the hard coded default did make sense in my specific use case back then, it does not make sense to have this hard-coded, and probably the most logical action would be not to show any due-date if neither due-date nor duration is given in the task, and also not to set any due date if nothing is given when creating the task. For users who wants to keep default duration when listing and/or creating tasks, it should be possible to specify this in the config file.

0.12 and (if there will be any) 0.13 should be backward-compatible with 0.11, hence the user has to be explicit either in the command line options or in the configuration to avoid default due dates in future 0.x-releases.

Feature: calendar-name option

Today one should enter a calendar-url to chose an alternative calendar - that's not much user friendly, even if relative URLs are allowed. Search by calendar name is trivial. We should have a --calendar-name option.

License is missing

Hi,

I couldn't find any information regarding the license your program is under - some might not be able to use your software until this is resolved.

Personally, I'd recommend an ISC-style license.

Regards,

Raf

python3: calendar-cli without options returns weird error rather than help

Ref #33, python2 is sunset now.

Apparently the subcommand stuff in argparse differs in python3

$ python2 ./calendar-cli 
usage: calendar-cli [-h] [--config-file FILE]
                    [--config-section CONFIG_SECTION] [--interactive-config]
                    [--version] [--nocaldav] [--icalendar]
                    [--timezone TIMEZONE] [--language LANGUAGE]
                    [--caldav-url URL] [--caldav-user USER]
                    [--caldav-pass PASS] [--caldav-proxy CALDAV_PROXY]
                    [--ssl-verify-cert SSL_VERIFY_CERT] [--debug-logging]
                    [--calendar-url CALENDAR_URL] [--ignoremethod]
                    {todo,journal,calendar} ...
calendar-cli: error: too few arguments

$ python3 ./calendar-cli
Traceback (most recent call last):
  File "./calendar-cli", line 925, in <module>
    main()
  File "./calendar-cli", line 922, in main
    ret = args.func(caldav_conn, args)
AttributeError: 'Namespace' object has no attribute 'func'

Odd interaction with DAViCal

I'm running a DAViCal server in which my user account has multiple associated calendars (specifically, "teaching", "research", and "administrative"). When I use calendar-cli to create a TODO and provide the URL of any calendar, the item is added to the research calendar. I would assume this to be a bug in DAViCal, but both my Android calendar sync client (DAV Droid) and my laptop's client (Thunderbird Lightning) have no trouble adding tasks to specific calendars.

I've checked the configuration parsing and calendar-cli is indeed passing the right URL to the underlying calendar library, but I thought I'd file this issue so that it's know that it exists (even if the problem turns out to be an underlying dependency instead of some way that calendar-cli is using it).

Bug: timezone issues when adding events on a date

  • When adding an event (or todo) with a date and no time, it will end up in the calendar at 00:00 UTC, and not local time. Should ensure that the time zone gets correct.
  • Need to ensure that events without time gets right in the test script
  • Need to ensure that the application is able to handle time zones in the test script

RFC4791 and METHOD property

Hi,

I receive frequently calendar invitations that include a METHOD property. According to RFC4791, paragraph 4.1 this must not happen, if I understand correctly.

The latter causes an exception like this:

aceback (most recent call last):
  File "./calendar-cli.py", line 866, in <module>
    main()
  File "./calendar-cli.py", line 863, in main
    ret = args.func(caldav_conn, args)
  File "./calendar-cli.py", line 183, in calendar_addics
    _calendar_addics(caldav_conn, c.to_ical(), uid, args)
  File "./calendar-cli.py", line 143, in _calendar_addics
    c.add_event(ics)
  File "~/.virtualenvs/calendar-cli/lib/python2.7/site-packages/caldav/objects.py", line 422, in add_event
    return Event(self.client, data = ical, parent = self).save()
  File "~/.virtualenvs/calendar-cli/lib/python2.7/site-packages/caldav/objects.py", line 718, in save
    self._create(self._instance.serialize(), self.id, path)
  File "~/.virtualenvs/calendar-cli/lib/python2.7/site-packages/caldav/objects.py", line 704, in _create
    raise error.PutError(r.raw)
caldav.lib.error.PutError: <?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>Sabre\DAV\Exception\UnsupportedMediaType</s:exception>
  <s:message>Validation error in iCalendar: A calendar object on a CalDAV server MUST NOT have a METHOD property.</s:message>
</d:error>

Would you consider handling this exception and selectively ignoring it for this use-case?

Python3-compatibility

When calendar-cli was created, the caldav-library only existed in python2-version, and it was further dependent on vobject, which also only existed in python2-version. Those obstacles have been solved now. "python2" is still hardcoded in the script though.

Even though "python2" is hardcoded in the script, when the script is installed through setup.py using python3, running the installed "calendar-cli" may invoke python3. The script has not been thoroughly tested under python3. It's needed to do quite some testing.

One bug spotted so far, run the script without any parameters, and argparse will print out a nice error message and user instructions when parser.parse_args is run on line 838 and exit. Under python3 this does not happen, and instead we get an ugly error on line 836 as func is undefined.

Package repository

Will this tool be installable via pip? Right now I am struggeling with manually installing the dependencies, as some of them are not found by pip.

Checking for conflicts before adding an event.

Hello,
it seems (at least on my setup) that I can add an event two times without any raised issue (with SOGo 3.2.7). Would it be possible to have an option to check for conflicts and return an error message/code in that case?

Interactive Mode: caldav_pass

I would use the module getpass to get the users password.
With this method the password is not echoed to the terminal.

Add todo without due

Is there a way to add items to a todo list without setting a due date?
I'm adding items to a shopping list which obv dont need a due date.

Crash for older start time etc.

Hi,

I highly appretiate your project, since a command line interface to CalDav is urgently needed.

Unfortunately calendar-cli.py keeps crashing for many operations, e.g.:

  • "calendar-cli.py calendar agenda --from-time 2017-04-01 --to-time 2017-07-01" works,
    but changing from-time to 2017-03-01 yields a crash:

Traceback (most recent call last):
File "/usr/local/bin/calendar-cli.py", line 866, in
main()
File "/usr/local/bin/calendar-cli.py", line 863, in main
ret = args.func(caldav_conn, args)
File "/usr/local/bin/calendar-cli.py", line 436, in calendar_agenda
events_ = find_calendar(caldav_conn, args).date_search(dtstart, dtend)
File "/usr/lib/python2.7/site-packages/caldav/objects.py", line 510, in date_search
Event(self.client, url=self.url.join(r), data=results[r][cdav.CalendarData.tag], parent=self))
File "/usr/lib/python2.7/site-packages/caldav/objects.py", line 724, in init
self.data = data
File "/usr/lib/python2.7/site-packages/caldav/objects.py", line 801, in _set_data
self._instance = vobject.readOne(to_unicode(self._data))
File "/usr/lib/python2.7/site-packages/vobject/base.py", line 1153, in readOne
allowQP))
File "/usr/lib/python2.7/site-packages/vobject/base.py", line 1125, in readComponents
component.transformChildrenToNative()
File "/usr/lib/python2.7/site-packages/vobject/base.py", line 674, in transformChildrenToNative
child.transformChildrenToNative()
File "/usr/lib/python2.7/site-packages/vobject/base.py", line 673, in transformChildrenToNative
child = child.transformToNative()
File "/usr/lib/python2.7/site-packages/vobject/base.py", line 185, in transformToNative
return self.behavior.transformToNative(self)
File "/usr/lib/python2.7/site-packages/vobject/icalendar.py", line 1386, in transformToNative
raise ParseError("DURATION must have a single duration string.")
vobject.base.ParseError: At line 9: DURATION must have a single duration string.

  • also a simple "calendar-cli.py calendar agenda" yields:

Traceback (most recent call last):
File "/usr/local/bin/calendar-cli.py", line 866, in
main()
File "/usr/local/bin/calendar-cli.py", line 863, in main
ret = args.func(caldav_conn, args)
File "/usr/local/bin/calendar-cli.py", line 436, in calendar_agenda
events_ = find_calendar(caldav_conn, args).date_search(dtstart, dtend)
File "/usr/lib/python2.7/site-packages/caldav/objects.py", line 507, in date_search
results = self._handle_prop_response(response=response, props=[cdav.CalendarData()])
File "/usr/lib/python2.7/site-packages/caldav/objects.py", line 145, in _handle_prop_response
for r in response.tree.findall('.//' + dav.Response.tag):
AttributeError: 'NoneType' object has no attribute 'findall'

My .config looks like:

{
"default": {
"caldav_url": "http://my-davical/caldav.php/",
"calendar_url": "my/calendar",
"caldav_user": "my",
"caldav_pass": "XXXXXX"
},
"all": {
"caldav_url": "http://my-davical/caldav.php/",
"calendar_url": "all/calendar",
"caldav_user": "all",
"caldav_pass": "XXXXXX"
}
}

Evolution and Lightning display proper calendar entries for both sections.

To be honest, nearly every invocation of calendar-cli.py crashes for me.
I am running Python 2.7.12 on an OpenSuSE 42.1.

What would be my mistake?
Is there a chance to catch errors before Python starts it's error handling?

Best regards

T. Finke

IndexError: list index out of range in File "./bin/calendar-cli.py", line 66, in find_calendar

I am trying to list calendar entries:

./bin/calendar-cli.py --caldav-url=http://localhost:5232 --caldav-user=d --caldav-pass=d calendar agenda
Traceback (most recent call last):
  File "./bin/calendar-cli.py", line 666, in <module>
    main()
  File "./bin/calendar-cli.py", line 663, in main
    ret = args.func(caldav_conn, args)
  File "./bin/calendar-cli.py", line 328, in calendar_agenda
    events_ = find_calendar(caldav_conn, args).date_search(dtstart, dtend)
  File "./bin/calendar-cli.py", line 66, in find_calendar
    return caldav.Principal(caldav_conn).calendars()[0]
IndexError: list index out of range

The server gives this:

PROPFIND request at / received
Request headers:
{'CONTENT_LENGTH': '189',
 'CONTENT_TYPE': 'text/xml',
 'GATEWAY_INTERFACE': 'CGI/1.1',
 'HTTP_ACCEPT': 'text/xml',
 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
 'HTTP_CONNECTION': 'keep-alive',
 'HTTP_DEPTH': '0',
 'HTTP_HOST': 'localhost:5232',
 'HTTP_USER_AGENT': 'Mozilla/5.0',
 'PATH_INFO': '/',
 'QUERY_STRING': '',
 'REMOTE_ADDR': '127.0.0.1',
 'REMOTE_HOST': 'localhost',
 'REQUEST_METHOD': 'PROPFIND',
 'SCRIPT_NAME': '',
 'SERVER_NAME': 'chinabox',
 'SERVER_PORT': '5232',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'SERVER_SOFTWARE': 'WSGIServer/0.1 Python/2.7.11',
 'wsgi.errors': <open file '<stderr>', mode 'w' at 0x7fbd3d9ec1e0>,
 'wsgi.file_wrapper': <class wsgiref.util.FileWrapper at 0x7fbd3b55a940>,
 'wsgi.input': <socket._fileobject object at 0x7fbd3b40ec50>,
 'wsgi.multiprocess': False,
 'wsgi.multithread': True,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'http',
 'wsgi.version': (1, 0)}
Sanitized path: /
Anonymous has read access to collection /
Anonymous has write access to collection /
Request content:
<?xml version='1.0' encoding='utf-8'?>
<ns0:propfind xmlns:C="urn:ietf:params:xml:ns:caldav" xmlns:D="DAV" xmlns:ns0="DAV:"><ns0:prop><ns0:current-user-principal/></ns0:prop></ns0:propfind>
Response content:
<?xml version="1.0"?>
<multistatus xmlns="DAV:">
  <response>
    <href>/</href>
    <propstat>
      <prop />
      <status>HTTP/1.1 200 OK</status>
    </propstat>
    <propstat>
      <prop>
        <current-user-principal />
      </prop>
      <status>HTTP/1.1 404 Not Found</status>
    </propstat>
  </response>
</multistatus>

Answer status: 207 Unknown
PROPFIND request at / received
Request headers:
{'CONTENT_LENGTH': '182',
 'CONTENT_TYPE': 'text/xml',
 'GATEWAY_INTERFACE': 'CGI/1.1',
 'HTTP_ACCEPT': 'text/xml',
 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
 'HTTP_CONNECTION': 'keep-alive',
 'HTTP_DEPTH': '0',
 'HTTP_HOST': 'localhost:5232',
 'HTTP_USER_AGENT': 'Mozilla/5.0',
 'PATH_INFO': '/',
 'QUERY_STRING': '',
 'REMOTE_ADDR': '127.0.0.1',
 'REMOTE_HOST': 'localhost',
 'REQUEST_METHOD': 'PROPFIND',
 'SCRIPT_NAME': '',
 'SERVER_NAME': 'chinabox',
 'SERVER_PORT': '5232',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'SERVER_SOFTWARE': 'WSGIServer/0.1 Python/2.7.11',
 'wsgi.errors': <open file '<stderr>', mode 'w' at 0x7fbd3d9ec1e0>,
 'wsgi.file_wrapper': <class wsgiref.util.FileWrapper at 0x7fbd3b55a940>,
 'wsgi.input': <socket._fileobject object at 0x7fbd3b40ec50>,
 'wsgi.multiprocess': False,
 'wsgi.multithread': True,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'http',
 'wsgi.version': (1, 0)}
Sanitized path: /
Anonymous has read access to collection /
Anonymous has write access to collection /
Request content:
<?xml version='1.0' encoding='utf-8'?>
<ns0:propfind xmlns:C="urn:ietf:params:xml:ns:caldav" xmlns:D="DAV" xmlns:ns0="DAV:"><ns0:prop><C:calendar-home-set/></ns0:prop></ns0:propfind>
Response content:
<?xml version="1.0"?>
<multistatus xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">
  <response>
    <href>/</href>
    <propstat>
      <prop>
        <C:calendar-home-set>
          <href>/</href>
        </C:calendar-home-set>
      </prop>
      <status>HTTP/1.1 200 OK</status>
    </propstat>
  </response>
</multistatus>

Answer status: 207 Unknown
PROPFIND request at / received
Request headers:
{'CONTENT_LENGTH': '179',
 'CONTENT_TYPE': 'text/xml',
 'GATEWAY_INTERFACE': 'CGI/1.1',
 'HTTP_ACCEPT': 'text/xml',
 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
 'HTTP_CONNECTION': 'keep-alive',
 'HTTP_DEPTH': '1',
 'HTTP_HOST': 'localhost:5232',
 'HTTP_USER_AGENT': 'Mozilla/5.0',
 'PATH_INFO': '/',
 'QUERY_STRING': '',
 'REMOTE_ADDR': '127.0.0.1',
 'REMOTE_HOST': 'localhost',
 'REQUEST_METHOD': 'PROPFIND',
 'SCRIPT_NAME': '',
 'SERVER_NAME': 'chinabox',
 'SERVER_PORT': '5232',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'SERVER_SOFTWARE': 'WSGIServer/0.1 Python/2.7.11',
 'wsgi.errors': <open file '<stderr>', mode 'w' at 0x7fbd3d9ec1e0>,
 'wsgi.file_wrapper': <class wsgiref.util.FileWrapper at 0x7fbd3b55a940>,
 'wsgi.input': <socket._fileobject object at 0x7fbd3b40ec50>,
 'wsgi.multiprocess': False,
 'wsgi.multithread': True,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'http',
 'wsgi.version': (1, 0)}
Sanitized path: /
Anonymous has read access to collection /
Anonymous has write access to collection /
Anonymous has read access to item a479f75f-ce91-41f6-9052-446c74be367d
Anonymous has write access to item a479f75f-ce91-41f6-9052-446c74be367d
Request content:
<?xml version='1.0' encoding='utf-8'?>
<ns0:propfind xmlns:C="urn:ietf:params:xml:ns:caldav" xmlns:D="DAV" xmlns:ns0="DAV:"><ns0:prop><ns0:resourcetype/></ns0:prop></ns0:propfind>
Response content:
<?xml version="1.0"?>
<multistatus xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">
  <response>
    <href>/a479f75f-ce91-41f6-9052-446c74be367d</href>
    <propstat>
      <prop>
        <resourcetype />
      </prop>
      <status>HTTP/1.1 200 OK</status>
    </propstat>
  </response>
  <response>
    <href>/</href>
    <propstat>
      <prop>
        <resourcetype>
          <principal />
          <C:calendar />
          <collection />
        </resourcetype>
      </prop>
      <status>HTTP/1.1 200 OK</status>
    </propstat>
  </response>
</multistatus>

Answer status: 207 Unknown

It's a simple radicale server.

--interactive crashes the program

Traceback (most recent call last):
  File "calendar-cli.py", line 904, in <module>
    main()
  File "calendar-cli.py", line 772, in main
    parser.set_defaults(**defaults)
UnboundLocalError: local variable 'defaults' referenced before assignment

Time stamp in events

Hi, I recently installed calendar-cli and it looks promising! However, display calendar agendas (from Nextcloud Server) shows the wrong event time, e.g. The event is scheduled for 10:00 o'clock in Nextcloud, calendar-cli shows 8:00 o'clock. Setting the timezone in config file to

"timezone": "Europe/Berlin"

does not work. Any suggestions? Thanks, Sven

Not really an issue, but a comment

Firstly, thank you for developing this. I have been looking for a good cli calendar replacement since I quit using Google Calendar.

  1. I have the script working and can add events to my calendar which is hosted at fruux.com.
    Adding an event by typing in the really long calendar URL is a bit cumbersome, is it possible to set a default calendar url and a default task url in the config file?
  2. In my config file I set the timezone to my local time, Europe/Stockholm. How do I add times to new events? It seems that my events always end up as being from 02.00.

Example given in README.md does not work

$ ./calendar-cli.py calendar --calendar-url=http://calendar.bekkenstenveien53c.oslo.no/caldav.php/tobias/calendar/ add 2013-10-01 testevent
usage: calendar-cli [-h] [--config-file FILE] [--config-section CONFIG_SECTION] [--interactive-config] [--version] [--nocaldav] [--icalendar] [--timezone TIMEZONE] [--language LANGUAGE] [--caldav-url URL] [--caldav-user USER] [--caldav-pass PASS] [--debug-logging] [--calendar-url CALENDAR_URL] {todo,calendar} ...
calendar-cli: error: unrecognized arguments: --calendar-url=http://calendar.bekkenstenveien53c.oslo.no/caldav.php/tobias/calendar/

edit: moving the --calendar-url before the calendar command in the command-line fixes this. It might be a bug in argparse (I already had issues with global/local options and different behavior with different versions of argparse).

Improve support for full-day-events

Hello, I have a quick question,
Is it possible to add a "full day" event? I am not talking about a 24-hour event, I do not know if I am clear...
Event Full Day :

Event 24h (23h59) :

KeyError: 'default' in File "./bin/calendar-cli.py", line 500, in config_section

>./bin/calendar-cli.py  -h
Traceback (most recent call last):
  File "./bin/calendar-cli.py", line 665, in <module>
    main()
  File "./bin/calendar-cli.py", line 552, in main
    defaults = config_section(config, args.config_section)
  File "./bin/calendar-cli.py", line 500, in config_section
    if 'inherits' in config[section]:
KeyError: 'default'

calendar-cli.py does not like Umlauts

I get errors whenever my new task contains a German Umlaut:

$ calendar-cli.py todo add den Ingeniör ist nichts zu schwör
Traceback (most recent call last):
File "/usr/bin/calendar-cli.py", line 866, in
main()
File "/usr/bin/calendar-cli.py", line 863, in main
ret = args.func(caldav_conn, args)
File "/usr/bin/calendar-cli.py", line 414, in todo_add
_calendar_addics(caldav_conn, cal.to_ical(), uid, args)
File "/usr/bin/calendar-cli.py", line 143, in _calendar_addics
c.add_event(ics)
File "/usr/local/lib/python2.7/dist-packages/caldav/objects.py", line 422, in add_event
return Event(self.client, data = ical, parent = self).save()
File "/usr/local/lib/python2.7/dist-packages/caldav/objects.py", line 718, in save
self._create(self._instance.serialize(), self.id, path)
File "/usr/local/lib/python2.7/dist-packages/vobject/base.py", line 255, in serialize
return behavior.serialize(self, buf, lineLength, validate)
File "/usr/local/lib/python2.7/dist-packages/vobject/behavior.py", line 162, in serialize
out = base.defaultSerialize(transformed, buf, lineLength)
File "/usr/local/lib/python2.7/dist-packages/vobject/base.py", line 993, in defaultSerialize
child.serialize(outbuf, lineLength, validate=False)
File "/usr/local/lib/python2.7/dist-packages/vobject/base.py", line 255, in serialize
return behavior.serialize(self, buf, lineLength, validate)
File "/usr/local/lib/python2.7/dist-packages/vobject/behavior.py", line 162, in serialize
out = base.defaultSerialize(transformed, buf, lineLength)
File "/usr/local/lib/python2.7/dist-packages/vobject/base.py", line 993, in defaultSerialize
child.serialize(outbuf, lineLength, validate=False)
File "/usr/local/lib/python2.7/dist-packages/vobject/base.py", line 255, in serialize
return behavior.serialize(self, buf, lineLength, validate)
File "/usr/local/lib/python2.7/dist-packages/vobject/behavior.py", line 162, in serialize
out = base.defaultSerialize(transformed, buf, lineLength)
File "/usr/local/lib/python2.7/dist-packages/vobject/base.py", line 1015, in defaultSerialize
foldOneLine(outbuf, s.getvalue(), lineLength)
File "/usr/lib/python2.7/StringIO.py", line 271, in getvalue
self.buf += ''.join(self.buflist)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 11: ordinal not in range(128)

Caldav-Request does not support SNI

When I try to fetch my calendar, I get the following error:
[...]
File "/usr/local/lib/python2.7/dist-packages/caldav/davclient.py", line 127, in propfind
return self.request(url or self.url, "PROPFIND", props, {'Depth': str(depth)})
File "/usr/local/lib/python2.7/dist-packages/caldav/davclient.py", line 227, in request
r = requests.request(method, url, data=to_wire(body), headers=combined_headers, proxies=proxies, auth=auth, verify=self.ssl_verify_cert)
[...]
requests.exceptions.SSLError: hostname 'XXXXXX' doesn't match 'YYYYYY'

My server has a valid certificate when the client requests it via SNI. What can I do to get this working? Is there some option to turn off cert verification as a workaround?

Ugly AssertationError without config

When installing and just calling calendar-cli without any configuration added, an AssertationError is thrown.
For a better user experience, display a warning about the missing configuration.

Traceback (most recent call last):
  File "/usr/bin/calendar-cli", line 4, in <module>
    __import__('pkg_resources').run_script('calendar-cli==0.0.0', 'calendar-cli')
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 666, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1469, in run_script
    exec(script_code, namespace, namespace)
  File "/usr/lib/python3.7/site-packages/calendar_cli-0.0.0-py3.7.egg/EGG-INFO/scripts/calendar-cli", line 911, in <module>
  File "/usr/lib/python3.7/site-packages/calendar_cli-0.0.0-py3.7.egg/EGG-INFO/scripts/calendar-cli", line 901, in main
  File "/usr/lib/python3.7/site-packages/calendar_cli-0.0.0-py3.7.egg/EGG-INFO/scripts/calendar-cli", line 118, in caldav_connect
  File "/usr/lib/python3.7/site-packages/caldav-0.6.1-py3.7.egg/caldav/davclient.py", line 96, in __init__
    if self.url.username is not None:
AttributeError: 'NoneType' object has no attribute 'username'

%F fails on Windows

I just noticed that the default date format %F fails on Windows,
tested with Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)] on win32) and calendar-cli.py with __version__ = "0.11.0".

I replaced %F with its equivalent %Y-%m-%d on lines 797 and 847 and confirmed it works.
Hope this would be helpful. Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.