-
Notifications
You must be signed in to change notification settings - Fork 6
/
leikdagar.py
57 lines (38 loc) · 1.53 KB
/
leikdagar.py
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Blank Python
import scraperwiki
from icalendar import Calendar, Event
from datetime import datetime
from icalendar import UTC # timezone
from icalendar import vCalAddress, vText
scraperwiki.sqlite.attach('leikdagar-pepsi-deild-karla-2011')
keys = scraperwiki.sqlite.execute('select * from `leikdagar_pepsi_deild_karla_2011` limit 0')['keys']
data = scraperwiki.sqlite.select('* from leikdagar_pepsi_deild_karla_2011')
#print data
#print keys
cal = Calendar()
cal.add('prodid', '-//My calendar product//mxm.dk//')
cal.add('version', '2.0')
event = Event()
event.add('summary', 'Python meeting about calendaring')
event.add('dtstart', datetime(2005,4,4,8,0,0,tzinfo=UTC))
event.add('dtend', datetime(2005,4,4,10,0,0,tzinfo=UTC))
event.add('dtstamp', datetime(2005,4,4,0,10,0,tzinfo=UTC))
#organizer = vCalAddress('MAILTO:[email protected]'
#organizer.params['cn'] = vText('Max Rasmussen')
#organizer.params['role'] = vText('CHAIR')
#event['organizer'] = organizer
event['location'] = vText('Odense, Denmark')
event['uid'] = '20050115T101010/[email protected]'
event.add('priority', 5)
attendee = vCalAddress('MAILTO:[email protected]')
attendee.params['cn'] = vText('Max Rasmussen')
attendee.params['ROLE'] = vText('REQ-PARTICIPANT')
event.add('attendee', attendee, encode=0)
attendee = vCalAddress('MAILTO:[email protected]')
attendee.params['cn'] = vText('The Dude')
attendee.params['ROLE'] = vText('REQ-PARTICIPANT')
event.add('attendee', attendee, encode=0)
cal.add_component(event)
print cal
#for row in data:
# print row