Ejemplo n.º 1
0
def journal_add(caldav_conn, args):
    ## TODO: copied from todo_add, should probably be consolidated
    cal = Calendar()
    cal.add('prodid', '-//{author_short}//{product}//{language}'.format(author_short=__author_short__, product=__product__, language=args.language))
    cal.add('version', '2.0')
    journal = Journal()
    ## TODO: what does the cryptic comment here really mean, and why was the dtstamp commented out?  dtstamp is required according to the RFC.
    ## TODO: (cryptic old comment:) not really correct, and it breaks i.e. with google calendar
    journal.add('dtstamp', datetime.now())
    journal.add('dtstart', date.today())
    journal.add('summary', ' '.join(args.summaryline))
    uid = uuid.uuid1()
    journal.add('uid', str(uid))
    cal.add_component(journal)
    _calendar_addics(caldav_conn, cal.to_ical(), uid, args)
    print("Added journal item with uid=%s" % uid)
Ejemplo n.º 2
0
def journal_add(caldav_conn, args):
    ## TODO: copied from todo_add, should probably be consolidated
    cal = Calendar()
    cal.add('prodid', '-//{author_short}//{product}//{language}'.format(author_short=__author_short__, product=__product__, language=args.language))
    cal.add('version', '2.0')
    journal = Journal()
    ## TODO: what does the cryptic comment here really mean, and why was the dtstamp commented out?  dtstamp is required according to the RFC.
    ## TODO: (cryptic old comment:) not really correct, and it breaks i.e. with google calendar
    journal.add('dtstamp', datetime.now())
    journal.add('dtstart', date.today())
    journal.add('summary', ' '.join(args.summaryline))
    uid = uuid.uuid1()
    journal.add('uid', str(uid))
    cal.add_component(journal)
    _calendar_addics(caldav_conn, cal.to_ical(), uid, args)
    print("Added journal item with uid=%s" % uid)
Ejemplo n.º 3
0
}

ical_freq_hsh = {
    'YEARLY': 'y',
    'MONTHLY': 'm',
    'WEEKLY': 'w',
    'DAILY': 'd',
    'HOURLY': 'h',
    'MINUTELY': 'n',
    # 'EASTERLY': 'e'
}

item_types = {
        '*': Event(),
        '-': Todo(),
        '%': Journal()
        }


# BEGIN:VCALENDAR
# VERSION:2.0
# PRODID:-//etm_tk 3.2.38//dgraham.us//
# BEGIN:VEVENT
# SUMMARY:Charleston Volvo Open
# DTSTART;VALUE=DATE:20190402
# UID:f42d3035fd634835a01f6193a925f32eetm
# RRULE:FREQ=DAILY;COUNT=4
# END:VEVENT
# END:VCALENDAR