[CalendarServer-changes] [2626] CalendarServer/branches/users/cdaboo/sqlpropstore-2623/twistedcaldav /directory/resource.py
source_changes at macosforge.org
source_changes at macosforge.org
Thu Jun 26 10:45:39 PDT 2008
Revision: 2626
http://trac.macosforge.org/projects/calendarserver/changeset/2626
Author: cdaboo at apple.com
Date: 2008-06-26 10:45:39 -0700 (Thu, 26 Jun 2008)
Log Message:
-----------
If we already have a child provisioned and saved, return that one.
Modified Paths:
--------------
CalendarServer/branches/users/cdaboo/sqlpropstore-2623/twistedcaldav/directory/resource.py
Modified: CalendarServer/branches/users/cdaboo/sqlpropstore-2623/twistedcaldav/directory/resource.py
===================================================================
--- CalendarServer/branches/users/cdaboo/sqlpropstore-2623/twistedcaldav/directory/resource.py 2008-06-26 03:39:32 UTC (rev 2625)
+++ CalendarServer/branches/users/cdaboo/sqlpropstore-2623/twistedcaldav/directory/resource.py 2008-06-26 17:45:39 UTC (rev 2626)
@@ -20,7 +20,7 @@
__all__ = ["AutoProvisioningResourceMixIn"]
-from twisted.internet.defer import maybeDeferred
+from twisted.internet.defer import maybeDeferred, succeed
class AutoProvisioningResourceMixIn (object):
"""
@@ -55,6 +55,12 @@
This implementation calls L{provision}, then super's L{locateChild}, thereby
ensuring that looked-up resources are provisioned.
"""
+
+ # If getChild() finds a child resource, return it - we've already been provisioned
+ child = self.putChildren.get(segments[0], None)
+ if child is not None:
+ return succeed((child, segments[1:]))
+
d = maybeDeferred(self.provision)
name = segments[0]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20080626/c2f4c833/attachment.htm
More information about the calendarserver-changes
mailing list