[CalendarServer-changes] [387] CalendarServer/trunk/twistedcaldav/method/post.py

source_changes at macosforge.org source_changes at macosforge.org
Tue Nov 7 15:59:46 PST 2006


Revision: 387
          http://trac.macosforge.org/projects/calendarserver/changeset/387
Author:   wsanchez at apple.com
Date:     2006-11-07 15:59:45 -0800 (Tue, 07 Nov 2006)

Log Message:
-----------
Get rid of defgen here; it's not saving us much in terms of code.

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/method/post.py

Modified: CalendarServer/trunk/twistedcaldav/method/post.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/method/post.py	2006-11-07 22:47:44 UTC (rev 386)
+++ CalendarServer/trunk/twistedcaldav/method/post.py	2006-11-07 23:59:45 UTC (rev 387)
@@ -29,7 +29,6 @@
 from twistedcaldav.method.schedule_common import processScheduleRequest
 
 def http_POST(self, request):
-
     """
     The CalDAV POST method.
     
@@ -38,21 +37,9 @@
     L{Deferred} callbacks. The logic is easier to follow this way plus we don't run into deep nesting
     issues which the other approach would have with large numbers of recipients.
     """
-
-    #
+    d = request.locateResource(parentForURL(request.uri))
     # Check authentication and access controls
-    #
-    parent = waitForDeferred(request.locateResource(parentForURL(request.uri)))
-    yield parent
-    parent = parent.getResult()
-
-    d = waitForDeferred(parent.authorize(request, (caldavxml.Schedule(),)))
-    yield d
-    d.getResult()
-        
-    # Initiate deferred generator
-    d = waitForDeferred(processScheduleRequest(self, "POST", request))
-    yield d
-    yield d.getResult()
-
-http_POST = deferredGenerator(http_POST)
+    d.addCallback(lambda parent: parent.authorize(request, (caldavxml.Schedule(),)))
+    # Do the work
+    d.addCallback(lambda _: processScheduleRequest(self, "POST", request))
+    return d

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20061107/36a6f9a5/attachment.html


More information about the calendarserver-changes mailing list