bernhard: utils/testing day_appointment.py,NONE,1.1
cvs at intevation.de
cvs at intevation.de
Mon Sep 13 11:45:42 CEST 2004
Author: bernhard
Update of /kolabrepository/utils/testing
In directory doto:/tmp/cvs-serv22563
Added Files:
day_appointment.py
Log Message:
Added day_appointment-0.1
changed to use Revision
some more description
used fake server and email addresses
--- NEW FILE: day_appointment.py ---
#!/bin/env python
"""Create many ical appointments for testing the KDE Kolab Client.
Redirect the output in a file and import this from the KDE Kolab Client.
You need to adapt the script, e.g. start time, how many appointments
and email addresses of the organizer and attendee.
This script is Free Software under the GNU General Public License >=v2.
bernhard at intevation.de
"""
#20030721 Bernhard initial (0.1)
__version__="$Revision: 1.1 $"[10:-1]
import time
# note because of the inverse time conversion functions
# mktime() and localtime() this _might_ behave differently from UTC
startingtimestring="20030615T224600Z"
increment_seconds=60*5
basenumber=100
how_many=12*14 # 14 hours
t=time.strptime(startingtimestring,"%Y%m%dT%H%M%SZ")
seconds=time.mktime(t)
header="""
BEGIN:VCALENDAR
PRODID
:-//K Desktop Environment//NONSGML libkcal 3.1//EN
VERSION
:2.0"""
footer="""END:VCALENDAR"""
dayfmt="""BEGIN:VEVENT
ORGANIZER
:MAILTO:bernhard8.reiter at moritz.kolab.org
ATTENDEE
;CN=Bernhard8 Reiter
;RSVP=FALSE
;PARTSTAT=ACCEPTED
;ROLE=REQ-PARTICIPANT
:mailto:bernhard8.reiter at moritz.kolab.orrg
SEQUENCE
:0
DESCRIPTION
:Mass test
SUMMARY
:A five minute appointment #%d
CLASS
:PUBLIC
PRIORITY
:3
DTSTART
:%s
DTEND
:%s
TRANSP
:OPAQUE
BEGIN:VALARM
DESCRIPTION
:
ACTION
:DISPLAY
TRIGGER
;VALUE=DURATION
:-PT1M
END:VALARM
END:VEVENT"""
print header
for i in range(how_many):
starts=seconds+increment_seconds*i
stops=seconds+increment_seconds*(i+1)
starttime=time.strftime("%Y%m%dT%H%M%SZ", time.localtime(starts))
endtime= time.strftime("%Y%m%dT%H%M%SZ", time.localtime(stops))
day= dayfmt % (basenumber+i,starttime, endtime)
print day
print footer
More information about the commits
mailing list