File: ical.py

package info (click to toggle)
bitpim 1.0.7%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 31,384 kB
  • sloc: python: 267,746; cpp: 2,076; perl: 600; ansic: 409; sh: 226; makefile: 152; sed: 1
file content (26 lines) | stat: -rw-r--r-- 729 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from appscript import app, its, k
import LaunchServices
import datetime

myical = app('iCal.app')
# myical.activate()

ourCal=0
sga=myical.calendars.filter(its.title=="N9YTY")

myEvent=sga.events.end.make(new=k.event)
myEvent.start_date.set(datetime.datetime.now())
myEvent.allday_event.set(1)
myEvent.summary.set("Test Python event!")

# newcal=myical.make(new=k.calendar)

#for anEvent in sga.events.get():
#    print "Start: ", anEvent.start_date.get()
#    print "Stop: ", anEvent.end_date.get()
#    print "AllDay: ", anEvent.allday_event.get()
#    print "UID: ", anEvent.uid.get()
#    print "Summary: ", anEvent.summary.get()
#    print "Description: ", anEvent.description.get()
#    print "- - - - - - - - - - - - - "