[CalendarServer-changes] [627]
CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/
static.py
source_changes at macosforge.org
source_changes at macosforge.org
Thu Nov 30 22:39:22 PST 2006
Revision: 627
http://trac.macosforge.org/projects/calendarserver/changeset/627
Author: wsanchez at apple.com
Date: 2006-11-30 22:39:21 -0800 (Thu, 30 Nov 2006)
Log Message:
-----------
Move inbox and outbox creation to CalendarHomeFile's init.
Modified Paths:
--------------
CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/static.py
Modified: CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/static.py
===================================================================
--- CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/static.py 2006-12-01 02:45:22 UTC (rev 626)
+++ CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/static.py 2006-12-01 06:39:21 UTC (rev 627)
@@ -405,7 +405,6 @@
),
)
-
class ScheduleOutboxFile (ScheduleOutboxResource, CalDAVFile):
"""
L{CalDAVFile} calendar outbox collection resource.
@@ -598,39 +597,29 @@
("outbox", ScheduleOutboxFile),
):
child_fp = self.fp.child(name)
- child = cls(child_fp.path)
- self.putChild(name, child)
-
- def provisionOnCreate(self):
- """
- Create all the child collections we need when the resource
- is first created.
- """
-
- # Create inbox & outbox
- for name, cls in (
- ("inbox" , ScheduleInboxFile),
- ("outbox", ScheduleOutboxFile),
- ):
- child_fp = self.fp.child(name)
- child = cls(child_fp.path)
+ child = cls(child_fp.path, principalCollections=parent.principalCollections())
if not child_fp.exists():
child_fp.makedirs()
if name == "inbox":
- # FIXME: This should probably be a directory record option that maps to the property value
- # directly without the need to store one.
+ # FIXME: This should probably be a directory record option that
+ # maps to the property value directly without the need to store one.
if self.record.recordType == "resource":
# Resources should have autorespond turned on by default,
# since they typically don't have someone responding for them.
child.writeDeadProperty(customxml.TwistedScheduleAutoRespond())
self.putChild(name, child)
+ def provisionOnCreate(self):
+ """
+ Create all the child collections we need when the resource
+ is first created.
+ """
calendars = []
for calendar in ("calendar",):
childURL = joinURL(self.url(), calendar)
child = CalDAVFile(os.path.join(self.fp.path, calendar))
c = child.createCalendarCollection()
- assert c.called
+ assert c.called # FIXME: (!)
c = c.result
calendars.append(childURL)
child.setAccessControlList(
@@ -648,7 +637,7 @@
# Set calendar-free-busy-set on Inbox if not already present
inbox = self.getChild("inbox")
if not inbox.hasDeadProperty(caldavxml.CalendarFreeBusySet()):
- fbset = caldavxml.CalendarFreeBusySet(*[davxml.HRef(uri) for uri in calendars])
+ fbset = caldavxml.CalendarFreeBusySet(*[davxml.HRef.fromString(uri) for uri in calendars])
inbox.writeDeadProperty(fbset)
# Do drop box if requested
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20061130/b7955b16/attachment.html
More information about the calendarserver-changes
mailing list