[CalendarServer-changes] [7612] CalendarServer/branches/users/glyph/quota/txdav/caldav/datastore

source_changes at macosforge.org source_changes at macosforge.org
Mon Jun 20 11:43:19 PDT 2011


Revision: 7612
          http://trac.macosforge.org/projects/calendarserver/changeset/7612
Author:   glyph at apple.com
Date:     2011-06-20 11:43:19 -0700 (Mon, 20 Jun 2011)
Log Message:
-----------
move quotaAllowedBytes to superclass

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/quota/txdav/caldav/datastore/file.py
    CalendarServer/branches/users/glyph/quota/txdav/caldav/datastore/sql.py
    CalendarServer/branches/users/glyph/quota/txdav/caldav/datastore/util.py

Modified: CalendarServer/branches/users/glyph/quota/txdav/caldav/datastore/file.py
===================================================================
--- CalendarServer/branches/users/glyph/quota/txdav/caldav/datastore/file.py	2011-06-20 18:43:07 UTC (rev 7611)
+++ CalendarServer/branches/users/glyph/quota/txdav/caldav/datastore/file.py	2011-06-20 18:43:19 UTC (rev 7612)
@@ -55,7 +55,8 @@
 from txdav.caldav.datastore.index_file import Index as OldIndex,\
     IndexSchedule as OldInboxIndex
 from txdav.caldav.datastore.util import (
-    validateCalendarComponent, dropboxIDFromCalendarObject, CalendarObjectBase
+    validateCalendarComponent, dropboxIDFromCalendarObject, CalendarObjectBase,
+    CalendarHomeBase
 )
 
 from txdav.caldav.icalendarstore import IAttachmentStorageTransport
@@ -79,7 +80,7 @@
 
 IGNORE_NAMES = ('dropbox', 'notification', 'freebusy')
 
-class CalendarHome(CommonHome):
+class CalendarHome(CommonHome, CalendarHomeBase):
     implements(ICalendarHome)
 
     _topPath = "calendars"
@@ -621,7 +622,21 @@
         props.flush()
 
 
+    def getPeer(self):
+        raise NotImplementedError()
+        return 'Storing attachment <%r>' % (self.attachment._path,)
 
+
+    def getHost(self):
+        raise NotImplementedError()
+        return 'Storing attachment (host) <%r>' % (self.attachment._path,)
+
+
+    def writeSequence(self, seq):
+        raise NotImplementedError()
+        return self.write(''.join(seq))
+
+
 class Attachment(FileMetaDataMixin):
     """
     An L{Attachment} is a container for the data associated with a I{locally-

Modified: CalendarServer/branches/users/glyph/quota/txdav/caldav/datastore/sql.py
===================================================================
--- CalendarServer/branches/users/glyph/quota/txdav/caldav/datastore/sql.py	2011-06-20 18:43:07 UTC (rev 7611)
+++ CalendarServer/branches/users/glyph/quota/txdav/caldav/datastore/sql.py	2011-06-20 18:43:19 UTC (rev 7612)
@@ -67,9 +67,10 @@
 from twext.enterprise.dal.syntax import utcNowSQL
 from twext.enterprise.dal.syntax import Len
 
-from txdav.caldav.datastore.util import CalendarObjectBase
+from txdav.caldav.datastore.util import CalendarObjectBase, CalendarHomeBase
 from txdav.caldav.icalendarstore import IAttachmentStorageTransport
 from txdav.caldav.icalendarstore import QuotaExceeded
+
 from txdav.common.icommondatastore import IndexedSearchException
 
 from pycalendar.datetime import PyCalendarDateTime
@@ -78,7 +79,7 @@
 
 from zope.interface.declarations import implements
 
-class CalendarHome(CommonHome):
+class CalendarHome(CommonHome, CalendarHomeBase):
 
     implements(ICalendarHome)
 
@@ -187,15 +188,7 @@
         yield self.createCalendarWithName("inbox")
 
 
-    def quotaAllowedBytes(self):
-        """
-        The configured number of allowed bytes for attachments in this calendar
-        home.
-        """
-        return 1000
 
-
-
 class Calendar(CommonHomeChild):
     """
     File-based implementation of L{ICalendar}.

Modified: CalendarServer/branches/users/glyph/quota/txdav/caldav/datastore/util.py
===================================================================
--- CalendarServer/branches/users/glyph/quota/txdav/caldav/datastore/util.py	2011-06-20 18:43:07 UTC (rev 7611)
+++ CalendarServer/branches/users/glyph/quota/txdav/caldav/datastore/util.py	2011-06-20 18:43:19 UTC (rev 7612)
@@ -218,7 +218,21 @@
     # released versions of CalendarServer.
 
 
+class CalendarHomeBase(object):
+    """
+    Base logic shared between file- and sql-based L{ICalendarHome}
+    implementations.
+    """
 
+    def quotaAllowedBytes(self):
+        """
+        The configured number of allowed bytes for attachments in this calendar
+        home.
+        """
+        return 1000
+
+
+
 class CalendarObjectBase(object):
     """
     Base logic shared between file- and sql-based L{ICalendarObject}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110620/0ae57bed/attachment.html>


More information about the calendarserver-changes mailing list