summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Brand <gb@unistra.fr>2020-07-07 19:57:57 +0200
committerGuy Brand <gb@unistra.fr>2020-07-07 19:57:57 +0200
commitcbc9af03b479fe0931e6585737a1d826e27a71c5 (patch)
tree4afb6a222b4a6d4d30e6b8668fce7b95bf060e7a
parent13c2616de265ead2ae6be6359f9f656a1474eeb6 (diff)
downloadcalendar-cli-cbc9af03b479fe0931e6585737a1d826e27a71c5.zip
Private events
-rwxr-xr-xcalendar-cli.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/calendar-cli.py b/calendar-cli.py
index 6e323f1..a6c16d1 100755
--- a/calendar-cli.py
+++ b/calendar-cli.py
@@ -350,6 +350,8 @@ def calendar_add(caldav_conn, args):
event.add('dtstart', dtstart)
## TODO: handle duration and end-time as options. default 3600s by now.
event.add('dtend', dtstart + timedelta(0,event_duration_secs))
+ if (args.private):
+ event.add('class', 'PRIVATE')
event.add('dtstamp', _now())
uid = uuid.uuid1()
event.add('uid', str(uid))
@@ -910,6 +912,7 @@ def main():
calendar_add_parser.add_argument('summary', nargs='+')
calendar_add_parser.set_defaults(func=calendar_add)
calendar_add_parser.add_argument('--whole-day', help='Whole-day event', action='store_true', default=False)
+ calendar_add_parser.add_argument('--private', help='Private event', action='store_true', default=False)
for attr in vcal_txt_one + vcal_txt_many:
calendar_add_parser.add_argument('--set-'+attr, help='Set '+attr)