4
# Copyright (c) 2005-2007 Apple Inc. All rights reserved.
6
# Licensed under the Apache License, Version 2.0 (the "License");
7
# you may not use this file except in compliance with the License.
8
# You may obtain a copy of the License at
10
# http://www.apache.org/licenses/LICENSE-2.0
12
# Unless required by applicable law or agreed to in writing, software
13
# distributed under the License is distributed on an "AS IS" BASIS,
14
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
# See the License for the specific language governing permissions and
16
# limitations under the License.
24
if __name__ == "__main__":
28
options, args = getopt.getopt(sys.argv[1:], "n:")
30
for option, value in options:
34
print "Unrecognized option: %s" % (option,)
37
for ctr in xrange(1, user_max + 1):
38
path = "calendars/users/user%02d" % (ctr,)
40
try: os.makedirs(path)
43
try: os.makedirs(os.path.join(path, "calendar"))
46
inboxname = os.path.join(path, "inbox")
47
attrs = xattr.xattr(inboxname)
48
attrs["WebDAV:{urn:ietf:params:xml:ns:caldav}calendar-free-busy-set"] = """<?xml version='1.0' encoding='UTF-8'?>
49
<calendar-free-busy-set xmlns='urn:ietf:params:xml:ns:caldav'>
50
<href xmlns='DAV:'>/calendars/users/user%02d/calendar/</href>
51
<href xmlns='DAV:'>/calendars/users/user%02d/calendar.1000/</href>
52
</calendar-free-busy-set>""" % (ctr, ctr,)