[Commits] (jeffrey) - per Aparna's request,
added a location to 2/3 of generated Events
commits at osafoundation.org
commits at osafoundation.org
Wed Feb 23 11:12:42 PST 2005
Commit by: jeffrey
Modified files:
chandler/parcels/osaf/contentmodel/tests/GenerateItems.py 1.26 1.27
Log message:
- per Aparna's request, added a location to 2/3 of generated Events
ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/contentmodel/tests/GenerateItems.py.diff?r1=text&tr1=1.26&r2=text&tr2=1.27
Index: chandler/parcels/osaf/contentmodel/tests/GenerateItems.py
diff -u chandler/parcels/osaf/contentmodel/tests/GenerateItems.py:1.26 chandler/parcels/osaf/contentmodel/tests/GenerateItems.py:1.27
--- chandler/parcels/osaf/contentmodel/tests/GenerateItems.py:1.26 Mon Feb 21 08:44:25 2005
+++ chandler/parcels/osaf/contentmodel/tests/GenerateItems.py Wed Feb 23 11:12:41 2005
@@ -2,8 +2,8 @@
Generate sample items: calendar, contacts, etc.
"""
-__revision__ = "$Revision: 1.26 $"
-__date__ = "$Date: 2005/02/21 16:44:25 $"
+__revision__ = "$Revision: 1.27 $"
+__date__ = "$Date: 2005/02/23 19:12:41 $"
__copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
@@ -32,6 +32,7 @@
return email
IMPORTANCE = ["important", "normal", "fyi"]
+LOCATIONS = ["Home", "Office", "School"]
def GenerateCalendarEvent(view, days=30):
event = Calendar.CalendarEvent(view=view)
@@ -53,6 +54,10 @@
reminderInterval = random.choice(REMINDERS)
if reminderInterval is not None:
event.reminderTime = event.startTime - DateTime.RelativeDateTime(minutes=reminderInterval)
+
+ # Add a location to 2/3 of the events
+ if random.randrange(3) > 0:
+ event.location = Calendar.Location.getLocation(view, random.choice(LOCATIONS))
event.importance = random.choice(IMPORTANCE)
return event
More information about the Commits
mailing list