4 from datetime import datetime
11 LOGINPREFIX="Utilisateur-"
13 # parameters: useridx, aptid, aptid, startutime, endutime, title, parts
15 INSERT INTO user_%i_quick
16 ( c_name, uid, startdate, enddate, title, participants )
18 '%s', '%s', %i, %i, '%s', '%s'
22 # parameters: aptid, utcstarttime, title
23 # 'BD91C454-AA65-11D8-84CA-000D93C1A604'
25 ICAL_TEMPLATE="""BEGIN:VEVENT
27 ATTENDEE;CN="Laurent Pierre":mailto:laurent@linagora.de
28 ATTENDEE;CN="Marcus Mueller":mailto:mm@skyrix.com
29 ATTENDEE;CN="Helge Hess":mailto:helge.hess@opengroupware.org
30 DTSTAMP:20040520T140002Z
39 # parameters: useridx, aptid, creationutime, lastmodutime, icalcontent
41 INSERT INTO user_%i_blob
42 ( c_name, c_creationdate, c_lastmodified, c_version, c_content )
44 ( '%s', %i, %i, 1, '%s' );
50 def createAptsForUser(login, idx):
51 print "-- User", idx, "login", login
52 for dayofyear in range(1, 365):
53 ICALID="%s-apt%i" % ( login, dayofyear )
55 STARTDATE = BASEDATE + DAYFACTOR * dayofyear;
56 start = datetime.utcfromtimestamp(STARTDATE)
57 utcstarttime="%04i%02i%02iT%02i%02i00" % ( start.year, start.month,
58 start.day, start.hour,
60 TITLE="Agenor %i (%s)" % ( dayofyear, login )
61 ical=ICAL_TEMPLATE % ( ICALID, utcstarttime, TITLE )
62 print BLOB_TEMPLATE % ( idx, ICALID, today11, today11,
65 PARTS="Laurent Pierre, Marcus Mueller, Helge Hess"
66 print QUICK_TEMPLATE % ( idx, ICALID, ICALID,
67 STARTDATE, STARTDATE + 3600,
70 print "-- end user", login
74 for i in range(2,200):
75 createAptsForUser("%s%i" % (LOGINPREFIX, i), i)