~ubuntu-branches/ubuntu/utopic/calendarserver/utopic

« back to all changes in this revision

Viewing changes to .pc/linux-xattr-fix.patch/twistedcaldav/test/data/makelargefbset.py

  • Committer: Package Import Robot
  • Author(s): Rahul Amaram
  • Date: 2012-05-29 18:12:12 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20120529181212-mxjdfncopy6vou0f
Tags: 3.2+dfsg-1
* New upstream release
* Moved from using cdbs to dh sequencer
* Modified calenderserver init.d script based on /etc/init.d/skeleton script
* Removed ldapdirectory.patch as the OpenLDAP directory service has been 
  merged upstream
* Moved package to section "net" as calendarserver is more service than 
  library (Closes: #665859)
* Changed Architecture of calendarserver package to any as the package
  now includes compiled architecture dependent Python extensions
* Unowned files are no longer left on the system upon purging
  (Closes: #668731)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
 
 
3
##
 
4
# Copyright (c) 2005-2007 Apple Inc. All rights reserved.
 
5
#
 
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
 
9
#
 
10
# http://www.apache.org/licenses/LICENSE-2.0
 
11
#
 
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.
 
17
##
 
18
 
 
19
import getopt
 
20
import os
 
21
import sys
 
22
import xattr
 
23
 
 
24
if __name__ == "__main__":
 
25
 
 
26
    user_max = 99
 
27
 
 
28
    options, args = getopt.getopt(sys.argv[1:], "n:")
 
29
 
 
30
    for option, value in options:
 
31
        if option == "-n":
 
32
            user_max = int(value)
 
33
        else:
 
34
            print "Unrecognized option: %s" % (option,)
 
35
            raise ValueError
 
36
 
 
37
    for ctr in xrange(1, user_max + 1): 
 
38
        path = "calendars/users/user%02d" % (ctr,)
 
39
    
 
40
        try: os.makedirs(path)
 
41
        except OSError: pass
 
42
    
 
43
        try: os.makedirs(os.path.join(path, "calendar"))
 
44
        except OSError: pass
 
45
    
 
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,)