[CalendarServer-changes] [5837] CalendarServer/branches/new-store/twistedcaldav/storebridge.py

source_changes at macosforge.org source_changes at macosforge.org
Thu Jul 1 22:15:55 PDT 2010


Revision: 5837
          http://trac.macosforge.org/projects/calendarserver/changeset/5837
Author:   glyph at apple.com
Date:     2010-07-01 22:15:53 -0700 (Thu, 01 Jul 2010)
Log Message:
-----------
Return a type that will give the expected errors, rather than None.

Modified Paths:
--------------
    CalendarServer/branches/new-store/twistedcaldav/storebridge.py

Modified: CalendarServer/branches/new-store/twistedcaldav/storebridge.py
===================================================================
--- CalendarServer/branches/new-store/twistedcaldav/storebridge.py	2010-07-02 05:06:58 UTC (rev 5836)
+++ CalendarServer/branches/new-store/twistedcaldav/storebridge.py	2010-07-02 05:15:53 UTC (rev 5837)
@@ -36,7 +36,7 @@
 from twext.web2.dav.element.base import dav_namespace
 from twext.web2.responsecode import (
     FORBIDDEN, NO_CONTENT, NOT_FOUND, CREATED, CONFLICT, PRECONDITION_FAILED,
-    BAD_REQUEST, OK)
+    BAD_REQUEST, OK, NOT_IMPLEMENTED, NOT_ALLOWED)
 from twext.web2.dav import davxml
 from twext.web2.dav.resource import TwistedGETContentMD5
 from twext.web2.dav.util import parentForURL, allDataFromStream, joinURL
@@ -296,7 +296,7 @@
     def getChild(self, name):
         calendarObject = self._newStoreCalendarHome.calendarObjectWithDropboxID(name)
         if calendarObject is None:
-            return None
+            return NoDropboxHere()
         return CalendarObjectDropbox(calendarObject)
 
 
@@ -307,9 +307,28 @@
     def listChildren(self):
         # FIXME: implement (needs to list attachments with attachments()
         raise NotImplementedError()
+    
+    
 
+class NoDropboxHere(_GetChildHelper, CalDAVResource):
+    
+    def isCollection(self):
+        return False
 
 
+    def http_GET(self, request):
+        return NOT_FOUND
+
+
+    def http_MKCALENDAR(self, request):
+        return NOT_ALLOWED
+
+
+    def http_MKCOL(self, request):
+        return NOT_IMPLEMENTED
+
+
+
 class CalendarObjectDropbox(_GetChildHelper, CalDAVResource):
 
     def __init__(self, calendarObject, *a, **kw):
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100701/b1d4f81a/attachment.html>


More information about the calendarserver-changes mailing list