[CalendarServer-changes] [5799] CalendarServer/branches/new-store/twistedcaldav
source_changes at macosforge.org
source_changes at macosforge.org
Tue Jun 22 14:00:37 PDT 2010
Revision: 5799
http://trac.macosforge.org/projects/calendarserver/changeset/5799
Author: glyph at apple.com
Date: 2010-06-22 14:00:32 -0700 (Tue, 22 Jun 2010)
Log Message:
-----------
Remove (now completely dead) provisionDefaultCalendars.
Modified Paths:
--------------
CalendarServer/branches/new-store/twistedcaldav/directory/calendar.py
CalendarServer/branches/new-store/twistedcaldav/schedule.py
CalendarServer/branches/new-store/twistedcaldav/static.py
Modified: CalendarServer/branches/new-store/twistedcaldav/directory/calendar.py
===================================================================
--- CalendarServer/branches/new-store/twistedcaldav/directory/calendar.py 2010-06-22 20:33:00 UTC (rev 5798)
+++ CalendarServer/branches/new-store/twistedcaldav/directory/calendar.py 2010-06-22 21:00:32 UTC (rev 5799)
@@ -281,55 +281,7 @@
assert isinstance(child, cls), "Child %r is not a %s: %r" % (name, cls.__name__, child)
self.putChild(name, child)
- def provisionDefaultCalendars(self):
- # Disable notifications during provisioning
- if hasattr(self, "clientNotifier"):
- self.clientNotifier.disableNotify()
-
- def setupFreeBusy(_):
- # Default calendar is initially opaque to freebusy
- child.writeDeadProperty(caldavxml.ScheduleCalendarTransp(caldavxml.Opaque()))
-
- # FIXME: Shouldn't have to call provision() on another resource
- # We cheat here because while inbox will auto-provision itself when located,
- # we need to write a dead property to it pre-emptively.
- # This will go away once we remove the free-busy-set property on inbox.
-
- # Set calendar-free-busy-set on inbox
- inbox = self.getChild("inbox")
- inbox.provision()
- inbox.processFreeBusyCalendar(childURL, True)
-
- # Default calendar is marked as the default for scheduling
- inbox.writeDeadProperty(caldavxml.ScheduleDefaultCalendarURL(davxml.HRef(childURL)))
-
- return self
-
- try:
- self.provision()
-
- childName = "calendar"
- childURL = joinURL(self.url(), childName)
- child = self.provisionChild(childName)
- assert isinstance(child, CalDAVResource), "Child %r is not a %s: %r" % (childName, CalDAVResource.__name__, child)
-
- d = child.createCalendarCollection()
- d.addCallback(setupFreeBusy)
- except:
- # We want to make sure to re-enable notifications, so do so
- # if there is an immediate exception above, or via errback, below
- if hasattr(self, "clientNotifier"):
- self.clientNotifier.enableNotify(None)
- raise
-
- # Re-enable notifications
- if hasattr(self, "clientNotifier"):
- d.addCallback(self.clientNotifier.enableNotify)
- d.addErrback(self.clientNotifier.enableNotify)
-
- return d
-
def provisionChild(self, name):
raise NotImplementedError("Subclass must implement provisionChild()")
Modified: CalendarServer/branches/new-store/twistedcaldav/schedule.py
===================================================================
--- CalendarServer/branches/new-store/twistedcaldav/schedule.py 2010-06-22 20:33:00 UTC (rev 5798)
+++ CalendarServer/branches/new-store/twistedcaldav/schedule.py 2010-06-22 21:00:32 UTC (rev 5799)
@@ -244,8 +244,6 @@
except StopIteration:
raise RuntimeError("No calendars at all.")
- # That won't help...
- # self.parent.provisionDefaultCalendars()
defaultCalendarURL = joinURL(calendarHomeURL, aCalendar.name())
self.writeDeadProperty(
Modified: CalendarServer/branches/new-store/twistedcaldav/static.py
===================================================================
--- CalendarServer/branches/new-store/twistedcaldav/static.py 2010-06-22 20:33:00 UTC (rev 5798)
+++ CalendarServer/branches/new-store/twistedcaldav/static.py 2010-06-22 21:00:32 UTC (rev 5799)
@@ -966,25 +966,7 @@
))
child.fp.changed()
break
- else:
- #
- # NOTE: provisionDefaultCalendars() returns a deferred, which we are ignoring.
- # The result being that the default calendars will be present at some point
- # in the future, not necessarily right now, and we don't have a way to wait
- # on that to finish.
- #
- child.provisionDefaultCalendars()
-
- #
- # Try to work around the above a little by telling the client that something
- # when wrong temporarily if the child isn't provisioned right away.
- #
- if not child.exists():
- raise HTTPError(StatusResponse(
- responsecode.SERVICE_UNAVAILABLE,
- "Provisioning calendar home."
- ))
-
+
assert child.exists()
else:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100622/83f4464f/attachment-0001.html>
More information about the calendarserver-changes
mailing list