[CalendarServer-changes] [1119] CalendarServer/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Fri Jan 26 11:03:57 PST 2007
Revision: 1119
http://trac.macosforge.org/projects/calendarserver/changeset/1119
Author: dreid at apple.com
Date: 2007-01-26 11:03:57 -0800 (Fri, 26 Jan 2007)
Log Message:
-----------
Add -d (documentroot) argument to makelargecalendars.py so it can run against a docroot other than twistedcaldav/test/data
Modified Paths:
--------------
CalendarServer/trunk/testcaldav
CalendarServer/trunk/twistedcaldav/test/data/makelargecalendars.py
Modified: CalendarServer/trunk/testcaldav
===================================================================
--- CalendarServer/trunk/testcaldav 2007-01-26 00:47:22 UTC (rev 1118)
+++ CalendarServer/trunk/testcaldav 2007-01-26 19:03:57 UTC (rev 1119)
@@ -75,6 +75,6 @@
curl "http://localhost:8008/calendars/users/user01/";
fi;
-cd "${documentroot}" && python makelargecalendars.py -n 1;
+python twistedcaldav/test/data/makelargecalendars.py -n 1 -d "${documentroot}";
cd "${cdt}" && python testcaldav.py -r "${documentroot}" -s "${serverinfo}" "$@";
Modified: CalendarServer/trunk/twistedcaldav/test/data/makelargecalendars.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/test/data/makelargecalendars.py 2007-01-26 00:47:22 UTC (rev 1118)
+++ CalendarServer/trunk/twistedcaldav/test/data/makelargecalendars.py 2007-01-26 19:03:57 UTC (rev 1119)
@@ -23,21 +23,25 @@
import sys
if __name__ == "__main__":
-
+ wd = os.path.dirname(__file__)
+ document_root = "."
user_max = 99
calendars = ("calendar.10", "calendar.100", "calendar.1000",)
- options, args = getopt.getopt(sys.argv[1:], "n:")
+ options, args = getopt.getopt(sys.argv[1:], "n:d:")
for option, value in options:
if option == "-n":
user_max = int(value)
+ elif option == "-d":
+ document_root = os.path.abspath(value)
else:
print "Unrecognized option: %s" % (option,)
raise ValueError
+
for ctr in xrange(1, user_max + 1):
- path = "calendars/users/user%02d" % (ctr,)
+ path = os.path.join(document_root, "calendars/users/user%02d" % (ctr,))
try: os.makedirs(path)
except OSError: pass
@@ -48,5 +52,7 @@
for calendar in calendars:
if not os.path.isdir(os.path.join(path, calendar)):
print "Expanding %s to %s" % (calendar, path)
- cmd = "tar -C %r -zx -f %r" % (path, calendar + ".tgz")
+ cmd = "tar -C %r -zx -f %r" % (path,
+ os.path.join(wd,
+ calendar + ".tgz"))
os.system(cmd)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20070126/924f54f6/attachment.html
More information about the calendarserver-changes
mailing list