Giter VIP home page Giter VIP logo

khal's Introduction

khal

https://github.com/pimutils/khal/actions/workflows/ci.yml/badge.svg?branch=master&event=push https://codecov.io/github/pimutils/khal/coverage.svg?branch=master https://readthedocs.org/projects/khal/badge/?version=latest&style=flat

Khal is a standards based CLI and terminal calendar program, able to synchronize with CalDAV servers through vdirsyncer.

http://lostpackets.de/images/khal.png

Features

(or rather: limitations)

  • khal can read and write events/icalendars to vdir, so vdirsyncer can be used to synchronize calendars with a variety of other programs, for example CalDAV servers.
  • fast and easy way to add new events
  • ikhal (interactive khal) lets you browse and edit calendars and events
  • no support for editing the timezones of events yet
  • works with python 3.8+
  • khal should run on all major operating systems [1]
[1]except for Microsoft Windows

Feedback

Please do provide feedback if khal works for you or even more importantly if it doesn't. The preferred way to get in contact (especially if something isn't working) is via github or via IRC (#pimutils on Libera.Chat).

Documentation

For khal's documentation have a look at readthedocs.

Installation

khal is packaged for most operating systems and should be installable with your standard package manager.

For some exemplary OS you can find installation instructions below. Otherwise see the documentation for more information.

Debian/Ubuntu

apt install khal

Nix

nix-env -i khal

Arch

pacman -S khal

Brew

brew install khal

Fedora

dnf install khal

FreeBSD

pkg install py-khal

Install latest version

pip install git+https://github.com/pimutils/khal

Alternatives

Projects with similar aims you might want to check out are calendar-cli (no offline storage and a bit different scope) and gcalcli (only works with google's calendar).

Contributing

You want to contribute to khal? Awesome!

The most appreciated way of contributing is by supplying code or documentation, reporting bugs, creating packages for your favorite operating system, making khal better known by telling your friends about it, etc.

License

khal is released under the Expat/MIT License:

Copyright (c) 2013-2022 khal contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

khal's People

Contributors

bradleyjones avatar coachshea avatar d7415 avatar dzoep avatar ephase avatar fpytloun avatar geier avatar heull001 avatar irbishop avatar jmehne avatar konfekt avatar lucc avatar mkobel avatar mpnordland avatar pdav avatar pfertyk avatar pre-commit-ci[bot] avatar psychicnoodles avatar rccoles avatar schubisu avatar sdx23 avatar sithglan avatar ssiegel avatar strk avatar takluyver avatar tgy avatar thomas-tim avatar untitaker avatar whynothugo avatar youngmoney 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  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

khal's Issues

google calendar sync issue

(tmp-28c39200d171d508)starenka /data/.envs/tmp-28c39200d171d508 % khal --sync                                                                                          [68% 05:33:08]
DEBUG:root:Using configuration::
DEBUG:root: accounts:
DEBUG:root:     google:
DEBUG:root:         auth: basic
DEBUG:root:         color: dark blue
DEBUG:root:         name: google
DEBUG:root:         readonly: False
DEBUG:root:         resource: https://www.google.com/calendar/dav/[email protected]/user/
DEBUG:root:         server_type: caldav
DEBUG:root:         ssl_verify: False
DEBUG:root:         user: [email protected]
DEBUG:root: debug: True
DEBUG:root: default:
DEBUG:root:     dateformat: %d.%m.
DEBUG:root:     datetimeformat: %d.%m. %H:%M
DEBUG:root:     debug: 1
DEBUG:root:     default_timezone: Europe/Prague
DEBUG:root:     encoding: utf-8
DEBUG:root:     firstweekday: 0
DEBUG:root:     local_timezone: Europe/Prague
DEBUG:root:     longdateformat: %d.%m.%Y
DEBUG:root:     longdatetimeformat: %d.%m.%Y %H:%M
DEBUG:root:     timeformat: %H:%M
DEBUG:root:     unicode_symbols: True
DEBUG:root: filename: /home/starenka/.config/khal/khal.conf
DEBUG:root: importing: None
DEBUG:root: list_accounts: False
DEBUG:root: new: None
DEBUG:root: sqlite:
DEBUG:root:     path: /home/starenka/.khal/khal.db
DEBUG:root: sync:
DEBUG:root:     accounts: set(['google'])
DEBUG:root: syncrun: True
DEBUG:root:created version table
DEBUG:root:created accounts table
DEBUG:root:starting to sync calendar `google`
DEBUG:root:syncing events in the next 365 days
DEBUG:root:Traceback (most recent call last):
File "/data/.envs/tmp-28c39200d171d508/local/lib/python2.7/site-packages/khal/khalendar.py", line 142, in sync
self._sync_caldav()
File "/data/.envs/tmp-28c39200d171d508/local/lib/python2.7/site-packages/khal/khalendar.py", line 164, in _sync_caldav
href_etag_list = syncer.get_hel(start=start_utc, end=end_utc)
File "/data/.envs/tmp-28c39200d171d508/local/lib/python2.7/site-packages/khal/caldav.py", line 235, in get_hel
etag = element.find('{DAV:}propstat').find('{DAV:}prop').find('{DAV:}getetag').text
AttributeError: 'NoneType' object has no attribute 'find'

contents of response was:

<?xml version="1.0" encoding="UTF-8"?>
<D:multistatus xmlns:D="DAV:" xmlns:caldav="urn:ietf:params:xml:ns:caldav" xmlns:cs="http://calendarserver.org/ns/" xmlns:ical="http://apple.com/ns/ical/">
 <D:response xmlns:carddav="urn:ietf:params:xml:ns:carddav">
  <D:href>/calendar/dav/[email protected]/user/</D:href>
  <D:propstat>
   <D:status>HTTP/1.1 200 OK</D:status>
  </D:propstat>
 </D:response>
</D:multistatus>

ImportError: No module named model

I get the following error when running khal from the master branch.

Traceback (most recent call last):
  File "/usr/local/bin/khal", line 5, in <module>
    pkg_resources.run_script('khal==0.1.0.dev', 'khal')
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 540, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 1462, in run_script
    exec_(script_code, namespace, namespace)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 41, in exec_
    exec("""exec code in globs, locs""")
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/khal-0.1.0.dev-py2.7.egg/EGG-INFO/scripts/khal", line 27, in <module>

  File "build/bdist.linux-x86_64/egg/khal/controllers.py", line 31, in <module>
  File "build/bdist.linux-x86_64/egg/khal/backend.py", line 80, in <module>
ImportError: No module named model

I couldn't find a module called model, so it seems this is a bug.

'NoneType' object has no attribute 'count'

I get this error when trying to khal --sync :

$ khal --sync
Server password (account Matthieu):
CRITICAL:root:While syncing account Matthieu an error occured:
'NoneType' object has no attribute 'count'

The caldav server is based on sabredav 1.8.7

ikhal: better help

these commands seem to be unmentioned:
- 'n' create a new event.
- 'd' delete event.
- 'TAB' Swicth focus.
- Left arrow to go back to calendar.

'datetime.date' object has no attribute 'tzinfo'

I am receving the following error when syncing:

jason@valis:~> khal --sync
Traceback (most recent call last):
  File "/usr/bin/khal", line 5, in <module>
    pkg_resources.run_script('khal==0.2.0.dev-62-g2c8baea', 'khal')
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 499, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 1255, in run_script
    execfile(script_filename, namespace, namespace)
  File "/usr/lib/python2.7/site-packages/khal-0.2.0.dev_62_g2c8baea-py2.7.egg/EGG-INFO/scripts/khal", line 74, in <module>
    default_tz=conf.default.default_timezone
  File "/usr/lib/python2.7/site-packages/khal-0.2.0.dev_62_g2c8baea-py2.7.egg/khal/khalendar/khalendar.py", line 82, in __init__
    self.db_update()
  File "/usr/lib/python2.7/site-packages/khal-0.2.0.dev_62_g2c8baea-py2.7.egg/khal/khalendar/khalendar.py", line 160, in db_update
    self.update_vevent(href)
  File "/usr/lib/python2.7/site-packages/khal-0.2.0.dev_62_g2c8baea-py2.7.egg/khal/khalendar/khalendar.py", line 166, in update_vevent
    ignore_invalid_items=True)
  File "/usr/lib/python2.7/site-packages/khal-0.2.0.dev_62_g2c8baea-py2.7.egg/khal/khalendar/backend.py", line 279, in update
    href)
  File "/usr/lib/python2.7/site-packages/khal-0.2.0.dev_62_g2c8baea-py2.7.egg/khal/khalendar/datetimehelper.py", line 35, in expand
    vevent['DTSTART'].dt.tzinfo is None):
AttributeError: 'datetime.date' object has no attribute 'tzinfo'

I was able to isolate it, by creating a test vdir with only the following ics file:

BEGIN:VCALENDAR
PRODID:-//Kerio Technologies//Kerio Connect//EN
METHOD:PUBLISH
VERSION:2.0
X-VERSION-KMS:6.2.0
X-CALENDARSERVER-ACCESS:PUBLIC
BEGIN:VTIMEZONE
TZID:Pacific Time (US & Canada), Tijuana
BEGIN:STANDARD
DTSTART:20071104T020000
TZOFFSETTO:-0800
TZOFFSETFROM:-0700
RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:20070311T020000
TZOFFSETTO:-0700
TZOFFSETFROM:-0800
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
DTSTAMP:20140110T230111Z
UID:44ab6485-cc1b-4d06-82a8-8e1eafa2190b
DTSTART;VALUE=DATE;TZID="Pacific Time (US & Canada), Tijuana":20140219
SUMMARY:all hands meeting
CLASS:PUBLIC
DTEND;VALUE=DATE;TZID="Pacific Time (US & Canada), Tijuana":20140220
X-LABEL:0
TRANSP:OPAQUE
X-MICROSOFT-CDO-BUSYSTATUS:BUSY
PRIORITY:5
END:VEVENT
END:VCALENDAR

KeyError: u'UID' while syncing

> khal --sync --debug                                                           
DEBUG:root:Using configuration from <HOME>/.config/khal/khal.conf
DEBUG:root:Using configuration::
DEBUG:root: accounts:
DEBUG:root:     private:
DEBUG:root:         auth: basic
DEBUG:root:         color: dark blue
DEBUG:root:         name: private
DEBUG:root:         readonly: False
DEBUG:root:         resource: https://URL
DEBUG:root:         server_type: caldav
DEBUG:root:         ssl_verify: True
DEBUG:root:         user: USERNAME
DEBUG:root:     mise:
DEBUG:root:         auth: basic
DEBUG:root:         color: 
DEBUG:root:         name: mise
DEBUG:root:         readonly: True
DEBUG:root:         resource: http://mise.inf.ethz.ch/mise.php?action=deliver_ical&what=current&usrid=9826AC6F556736AD05D7EA9CB3BBAD09
DEBUG:root:         server_type: http
DEBUG:root:         ssl_verify: False
DEBUG:root:         user: None
DEBUG:root: debug: True
DEBUG:root: default:
DEBUG:root:     dateformat: %d.%m.
DEBUG:root:     datetimeformat: %d.%m. %H:%M
DEBUG:root:     debug: 0
DEBUG:root:     default_timezone: Europe/London
DEBUG:root:     encoding: utf-8
DEBUG:root:     firstweekday: 0
DEBUG:root:     local_timezone: Europe/Berlin
DEBUG:root:     longdateformat: %d.%m.%Y
DEBUG:root:     longdatetimeformat: %d.%m.%Y %H:%M
DEBUG:root:     timeformat: %H:%M
DEBUG:root:     unicode_symbols: True
DEBUG:root: filename: <HOME>/.config/khal/khal.conf
DEBUG:root: importing: None
DEBUG:root: list_accounts: False
DEBUG:root: new: None
DEBUG:root: sqlite:
DEBUG:root:     path: <HOME>/.config/khal/khal.db
DEBUG:root: sync:
DEBUG:root:     accounts: set(['mise', 'private'])
DEBUG:root: syncrun: True
DEBUG:root:created version table
DEBUG:root:created accounts table
DEBUG:root:starting to sync calendar `mise`
DEBUG:root:Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/khal-0.1.0.dev-py2.7.egg/khal/khalendar.py", line 126, in sync
    self._sync_http()
  File "/usr/local/lib/python2.7/dist-packages/khal-0.1.0.dev-py2.7.egg/khal/khalendar.py", line 208, in _sync_http
    remote_uids.append(str(component['UID']))
  File "/usr/local/lib/python2.7/dist-packages/icalendar/caselessdict.py", line 43, in __getitem__
    return dict.__getitem__(self, key.upper())
KeyError: u'UID'

CRITICAL:root:While syncing account `mise` an error occured:
  u'UID'
DEBUG:root:starting to sync calendar `private`
DEBUG:root:syncing events in the next 365 days
DEBUG:root:0 event(s) need(s) an update
DEBUG:root:0 new events need to be uploaded

sqlite error if running khal without first running khal --sync

If khal or ikhal is run without first running khal --sync, a user will get an error looking something like the following.

Traceback (most recent call last):
  File "/home/catern/src/khal/virt/bin/khal", line 5, in <module>
    pkg_resources.run_script('khal==0.1.0.dev', 'khal')
  File "/home/catern/src/khal/virt/lib/python2.7/site-packages/pkg_resources.py", line 540, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/home/catern/src/khal/virt/lib/python2.7/site-packages/pkg_resources.py", line 1462, in run_script
    exec_(script_code, namespace, namespace)
  File "/home/catern/src/khal/virt/lib/python2.7/site-packages/pkg_resources.py", line 41, in exec_
    exec("""exec code in globs, locs""")
  File "<string>", line 1, in <module>
  File "/home/catern/src/khal/virt/lib/python2.7/site-packages/khal-0.1.0.dev-py2.7.egg/EGG-INFO/scripts/khal", line 72, in <module>

  File "build/bdist.linux-x86_64/egg/khal/controllers.py", line 178, in __init__
  File "build/bdist.linux-x86_64/egg/khal/backend.py", line 440, in get_allday_range
  File "build/bdist.linux-x86_64/egg/khal/backend.py", line 164, in sql_ex
sqlite3.OperationalError: no such table: simple_d

icalendar AssertionError: A str/unicode expected error

I am trying to use khal on Fedora 20 and get the following when try to sync to calendar entries. I am using ownCloud on the backend, and I removed the actual URL from the debug.

khal --sync --debug
DEBUG:root:Using configuration from /home/zoglesby/.khal/khal.conf
DEBUG:root:Using configuration::
DEBUG:root: accounts:
DEBUG:root: home:
DEBUG:root: auth: basic
DEBUG:root: color: dark blue
DEBUG:root: name: home
DEBUG:root: readonly: False
DEBUG:root: resource: https://owncloud.url
DEBUG:root: server_type: caldav
DEBUG:root: ssl_verify: True
DEBUG:root: user: zoglesby
DEBUG:root: debug: True
DEBUG:root: default:
DEBUG:root: dateformat: %d.%m.
DEBUG:root: datetimeformat: %d.%m. %H:%M
DEBUG:root: debug: 0
DEBUG:root: default_timezone: America/New_York
DEBUG:root: encoding: utf-8
DEBUG:root: firstweekday: 6
DEBUG:root: local_timezone: America/New_York
DEBUG:root: longdateformat: %d.%m.%Y
DEBUG:root: longdatetimeformat: %d.%m.%Y %H:%M
DEBUG:root: timeformat: %H:%M
DEBUG:root: unicode_symbols: False #True
DEBUG:root: filename: /home/zoglesby/.khal/khal.conf
DEBUG:root: importing: None
DEBUG:root: list_accounts: False
DEBUG:root: new: None
DEBUG:root: sqlite:
DEBUG:root: path: /home/zoglesby/.khal/khal.db
DEBUG:root: sync:
DEBUG:root: accounts: set(['home'])
DEBUG:root: syncrun: True
DEBUG:root:created version table
DEBUG:root:created accounts table
DEBUG:root:starting to sync calendar home
DEBUG:root:syncing events in the next 365 days
DEBUG:root:0 event(s) need(s) an update
DEBUG:root:1 new events need to be uploaded
DEBUG:root:Traceback (most recent call last):
File "build/bdist.linux-x86_64/egg/khal/khalendar.py", line 124, in sync
self._sync_caldav()
File "build/bdist.linux-x86_64/egg/khal/khalendar.py", line 167, in _sync_caldav
self._default_timezone)
File "build/bdist.linux-x86_64/egg/khal/caldav.py", line 387, in upload
timezone = self._create_timezone(default_timezone) # FIXME
File "build/bdist.linux-x86_64/egg/khal/caldav.py", line 353, in _create_timezone
timezone.add('TZID', tz)
File "/usr/lib/python2.7/site-packages/icalendar/cal.py", line 147, in add
self.set(name, value, encode)
File "/usr/lib/python2.7/site-packages/icalendar/cal.py", line 123, in set
self[name] = self._encode(name, value, encode)
File "/usr/lib/python2.7/site-packages/icalendar/cal.py", line 110, in _encode
obj = klass(value)
File "/usr/lib/python2.7/site-packages/icalendar/prop.py", line 681, in new
value = to_unicode(value, encoding=encoding)
File "/usr/lib/python2.7/site-packages/icalendar/parser_tools.py", line 15, in to_unicode
raise AssertionError('A str/unicode expected.')
AssertionError: A str/unicode expected.

CRITICAL:root:While syncing account home an error occured:
A str/unicode expected.

Make Sync range configurable

Hi!

Would it be possible to make the range, the calendar is synced into the past (or into the future for that matter), configurable for each calendar?

Thanks!

sort out license issue in ui.py

khal.ui.Date (mostly keypress()) contains code taken from urwid which is LGPL

perhaps we can get rid of (at least most of) it by calling super().keypress()

New events default to wrong calendar

I have two calendars in khal: when I enter a new event via ikhal and select the first calendar for the event, when I complete the entry and hit 'save', the event is always saved in the second calendar. I have to open the event, reselect the first calendar and then re-save for it to be moved to that calendar.

Using the git version.

401 Client Error with Baikal server

Hello,

I have just installed khal and try to sync with a Baikal server.
But when I run "khal --sync", I obtain an error "401 Client Error".

Could you help me to solve this behaviour ?

Regards

Delete Event Bug

I was playing with the delete function in ikhal.
I noticed that if I hit d while an event that has past is highlighted
I'll see a D next to that event and the next time I run ikhal the event
will have been deleted.

So then I made a test event that would happen in the future.
I exited ikhal and then relaunched it.
This time I highlighted the new event that had not happened yet and hit
d. In this case, I got an x next to the event.

I saved ikhal and closed it.
When I reopened ikhal the event was gone - great.

Here is the rub, after deleting the event that had already taken place I
could sync khal normally, but after deleting the event that has not yet
occurred I get the following error every time:

DEBUG:root:Traceback (most recent call last):
File
"/usr/local/lib/python2.7/dist-packages/khal-0.1.0.dev-py2.7.egg/khal/khalendar.py",
line 124, in sync
self._sync_caldav()
File
"/usr/local/lib/python2.7/dist-packages/khal-0.1.0.dev-py2.7.egg/khal/khalendar.py",
line 187, in _sync_caldav
if syncer.test_deleted(href) and self._dbtool.get_status(href,
self.name) != NEW:
File
"/usr/local/lib/python2.7/dist-packages/khal-0.1.0.dev-py2.7.egg/khal/caldav.py",
line 305, in test_deleted
response.raise_for_status()
File
"/usr/local/lib/python2.7/dist-packages/requests-2.2.1-py2.7.egg/requests/models.py",
line 773, in raise_for_status
raise HTTPError(http_error_msg, response=self)
HTTPError: 403 Client Error: Forbidden

I wish I could help you guys more by actually writing code to fix
problems, but my coding is limited to fairly simple BASH scripts.

Failed to create /home/jd/.khal

When starting khal I get the following error:

CRITICAL:root:failed to create /home/jd/.khal: [Errno 13] Permission denied: '/home/jd'

If you want to get the user's home, use:

os.path.expanduser('~')

Be sure to deal with the error case when it's not possible for python to figure this out.

write support

write support seems to be undocumented yet.

Calling khal --sync, after adding an event, tells me INFO:root:failed to upload a new event, you need to enable write support to use this feature, see the documentation. which I cannot find.

How can I enable write support?

khal / khal / caldav.py - line breaks needed in line 310

I got the following error with latest git master:

Traceback (most recent call last):
  File "/usr/bin/khal", line 59, in <module>
    from khal import khalendar, backend
  File "/usr/lib/python2.7/site-packages/khal/khalendar.py", line 36, in <module>
    from khal import backend, caldav
  File "/usr/lib/python2.7/site-packages/khal/caldav.py", line 310
    if response.status_code == 404: return True else: raise

Line 310 reads

            if response.status_code == 404: return True else:  raise

Inserting line breaks helps:

            if response.status_code == 404: 
                return True 
            else: 
                raise

ikhal startup after sync

Thank you for this great program, I've been waiting for this :)

I successfully synced my owncloud calendars and am able to start khal without problems. However, when I start ikhal (master as of 12-12-22) I get this:

DEBUG:root:Using configuration:
DEBUG:root:created version table
DEBUG:root:created accounts table
Traceback (most recent call last):
File "/usr/bin/ikhal", line 5, in
pkg_resources.run_script('khal==0.1.0.dev', 'ikhal')
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 487, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 1344, in run_script
exec(script_code, namespace, namespace)
File "/usr/lib/python2.7/site-packages/khal-0.1.0.dev-py2.7.egg/EGG-INFO/scripts/ikhal", line 48, in

File "build/bdist.linux-x86_64/egg/khal/controllers.py", line 223, in init
File "build/bdist.linux-x86_64/egg/khal/ui/init.py", line 825, in init
File "build/bdist.linux-x86_64/egg/khal/ui/init.py", line 227, in calendar_walker
File "build/bdist.linux-x86_64/egg/khal/ui/init.py", line 213, in construct_week
File "build/bdist.linux-x86_64/egg/khal/ui/init.py", line 153, in init
File "/usr/lib/python2.7/site-packages/urwid/container.py", line 1742, in init
self.focus_position = focus_column
File "build/bdist.linux-x86_64/egg/khal/ui/init.py", line 163, in _set_focus_position
File "build/bdist.linux-x86_64/egg/khal/ui/init.py", line 839, in show_date
File "build/bdist.linux-x86_64/egg/khal/ui/init.py", line 367, in update
File "build/bdist.linux-x86_64/egg/khal/ui/init.py", line 341, in update
File "build/bdist.linux-x86_64/egg/khal/ui/init.py", line 255, in init
File "build/bdist.linux-x86_64/egg/khal/model.py", line 115, in compact
File "build/bdist.linux-x86_64/egg/khal/model.py", line 164, in _compact_datetime
File "build/bdist.linux-x86_64/egg/khal/model.py", line 87, in end
File "/usr/lib/python2.7/site-packages/icalendar/caselessdict.py", line 43, in getitem
return dict.getitem(self, key.upper())
KeyError: u'DTEND'

Is this a problem with my ical data?

set default calendar

hi,

im just unsure how to set my default calendar when i'm using multiple ones ?

thx :)

recurring event displays wrong time during daylight savings time

Hi, I have a recurring event that is every Monday at 9:30. khal/ikhal display at at 9:30 during standard time correctly, but not during daylight savings time. During daylight savings time, it shows the meetings as starting at 10:30.

To make sure I can see the actual contents of the event, I added a debug line in the section of backend.py where it looks at recurring events:

logging.debug(vevent.to_ical())

When I sync, it outputs the following for my recurring event (atendees snipped out):

DEBUG:root:BEGIN:VEVENT
SUMMARY:Sales/FAE Call Skype
DTSTART;TZID=America/Tijuana:20131118T093000
DTEND;TZID=America/Tijuana:20131118T103000
DTSTAMP:20131118T173513Z
UID:6916DABE-8FEF-4DD1-877A-AA328999C1D7
SEQUENCE:28
CLASS:PUBLIC
RRULE:FREQ=WEEKLY;BYDAY=MO
TRANSP:OPAQUE
X-MICROSOFT-CDO-BUSYSTATUS:BUSY
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
END:VEVENT

It should always appear as 9:30 regardless of whether it's standard or daylight savings time.

Export an event

It would be great to be able to select an event and then export it as a list of space separated fields (sort of a reverse --new) to stdout so that it could be scripted to send to an email client as a sort of rudimentary invitation.

This would complete the calendaring "lifecycle".

README lies (khal is not on pypi)

matej@wycliff: ~$ pip install khal
Downloading/unpacking khal
  Could not find any downloads that satisfy the requirement khal
No distributions at all found for khal
Storing complete log in /home/matej/.pip/pip.log
matej@wycliff: ~$ 

"khal --sync" not working in vdir branch

I receive the following error when trying to sync. (Things display fine in ikhal, it's just khal that doesn't work)

jason@valis:~> khal --sync
Traceback (most recent call last):
File "/usr/bin/khal", line 5, in
pkg_resources.run_script('khal==0.2.0.dev-62-g2c8baea', 'khal')
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 499, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 1255, in run_script
execfile(script_filename, namespace, namespace)
File "/usr/lib/python2.7/site-packages/khal-0.2.0.dev_62_g2c8baea-py2.7.egg/EGG-INFO/scripts/khal", line 79, in
sys.exit(collection.updatedb)
AttributeError: 'CalendarCollection' object has no attribute 'updatedb'

simple medium range export

I would like a simple medium range export for syncing khal stuff with other calendars (org-mode is what I want).

This works well for me:

from khal import ConfigurationParser
from khal import controllers

# Read configuration.
conf_parser = ConfigurationParser('khal for CalDAV')
conf = conf_parser.parse()

from khal import khalendar, backend
dbtool = backend.SQLiteDb(conf)
collection = khalendar.CalendarCollection()
cal_conf = conf.accounts["home"]
cal = khalendar.Calendar(
    name="home",
    dbtool=dbtool,
    resource=cal_conf['resource'],
    username=cal_conf['user'],
    password=cal_conf['password'],
    auth=cal_conf['auth'],
    ssl_verify=cal_conf['ssl_verify'],
    server_type=cal_conf['server_type'],
    readonly=cal_conf['readonly'],
    color=cal_conf['color'],
    unicode_symbols=conf.default.unicode_symbols,
    local_timezone=conf.default.local_timezone,
    default_timezone=conf.default.default_timezone
)
from datetime import datetime, timedelta
now = datetime.now()
days_30 = timedelta(days=30)
for evt in cal.get_by_time_range(now, now + days_30):
    print evt.compact(now, timeformat="%Y-%m-%d %H:%M")

Would you consider including something like this if I sent you a PR?

delete events from khal

suggested usage:

khal --delete 04.15 09:00 11:30 some event

khal --edit 04.15 09:00 11:30 some event - new time 09:00 12:00

(not sure how practical that really is)

SSL Error 185090050

Using khal --sync I get the following error:
CRITICAL:root:While syncing account Private an error occured:
[Errno 185090050] _ssl.c:345: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib

Tried "verify: True", "verify: False" and "verify: /etc/ssl/certs/92d3fa0b.0" with the correct path to the root certificate of the CA. - None works.

My webserver log shows me that there is no connection, so the error occurs before khal starts a connection.

I am using:
python v2.7.5-5
python-httplib2 v0.8-2
python-lxml v3.2.0-1
python-requests v1.2.3-1
python-xdg v0.25-3
python-urwid v1.1.1-1
python-icalendar v3.5-2
and the latest git version of khal (

FYI: pycardDAV works great with the same server...

Any clue how to solve this issue? - Thanks & kind regards

--list action (list upcoming events)

Hi, thanks for the work on this nice project.

Would it be possible to just list upcoming events in a terminal?

I'd like to just type khal --list and be presented with a list of upcoming events. There could a be a switch like --days to specify how many days in advance will be shown (sometimes I don't have an entry for today or tomorrow, but I'd like to see events in the next week, so --days 7)

pip install doesn't resolve depends

Here's what I had to do:

virtualenv khal
khal/bin/pip install khal
khal/bin/pip install pytz
khal/bin/pip install pyxdg
khal/bin/pip install icalendar
khal/bin/khal --help # all good

fixing that would be excellent, I'll try and send you a PR if I have the time.

Task support

Would be great to have reminder (tasks) supported in khal, not just events.

BEGIN:VTODO

owncloud sync failes

I am new to khal, so maybe I the error is on my side. However, I configured my owncloud account but the initial sync fails.
The debug output is given below. If you need any further informatoin please let me know. Thanks!

DEBUG:root:Using configuration::
DEBUG:root:     accounts:
DEBUG:root:             priv:
DEBUG:root:                     auth: basic
DEBUG:root:                     color: dark green
DEBUG:root:                     name: priv
DEBUG:root:                     readonly: True
DEBUG:root:                     resource: https:/***/owncloud/remote.php/caldav/calendars/***/defaultcalendar
DEBUG:root:                     server_type: http
DEBUG:root:                     ssl_verify: False
DEBUG:root:                     user: ***
DEBUG:root:     debug: True
DEBUG:root:     default:
DEBUG:root:             dateformat: %d.%m.
DEBUG:root:             datetimeformat: %d.%m. %H:%M
DEBUG:root:             debug: 1
DEBUG:root:             default_timezone: America/New_York
DEBUG:root:             encoding: utf-8
DEBUG:root:             firstweekday: 0
DEBUG:root:             local_timezone: Europe/Berlin
DEBUG:root:             longdateformat: %d.%m.%Y
DEBUG:root:             longdatetimeformat: %d.%m.%Y %H:%M
DEBUG:root:             timeformat: %H:%M
DEBUG:root:             unicode_symbols: True
DEBUG:root:     filename: /home/smu/.khal/khal.conf
DEBUG:root:     importing: None
DEBUG:root:     list_accounts: False
DEBUG:root:     new: None
DEBUG:root:     sqlite:
DEBUG:root:             path: /home/smu/.khal/khal.db
DEBUG:root:     sync:
DEBUG:root:             accounts: set(['priv'])
DEBUG:root:     syncrun: True
DEBUG:root:created version table
DEBUG:root:created accounts table
DEBUG:root:starting to sync calendar `priv`
DEBUG:root:Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/khal/khalendar.py", line 126, in sync
    self._sync_http()
  File "/usr/lib/python2.7/site-packages/khal/khalendar.py", line 204, in _sync_http
    cal = icalendar.Calendar.from_ical(ics)
  File "/usr/lib/python2.7/site-packages/icalendar/cal.py", line 301, in from_ical
    name, params, vals = line.parts()
  File "/usr/lib/python2.7/site-packages/icalendar/parser.py", line 326, in parts
    % (self, exc)
ValueError: Content line could not be parsed into parts: u'<html>': <html>

CRITICAL:root:While syncing account `priv` an error occured:
  Content line could not be parsed into parts: u'<html>': <html>

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.