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

source_changes at macosforge.org source_changes at macosforge.org
Mon Jun 20 11:46:10 PDT 2011


Revision: 7627
          http://trac.macosforge.org/projects/calendarserver/changeset/7627
Author:   glyph at apple.com
Date:     2011-06-20 11:46:10 -0700 (Mon, 20 Jun 2011)
Log Message:
-----------
quotaAllowedBytes, for real.

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:45:58 UTC (rev 7626)
+++ CalendarServer/branches/users/glyph/quota/txdav/caldav/datastore/file.py	2011-06-20 18:46:10 UTC (rev 7627)
@@ -56,7 +56,7 @@
     IndexSchedule as OldInboxIndex
 from txdav.caldav.datastore.util import (
     validateCalendarComponent, dropboxIDFromCalendarObject, CalendarObjectBase,
-    CalendarHomeBase, StorageTransportBase
+    StorageTransportBase
 )
 
 from txdav.common.datastore.file import (
@@ -80,18 +80,23 @@
 
 IGNORE_NAMES = ('dropbox', 'notification', 'freebusy')
 
-class CalendarHome(CommonHome, CalendarHomeBase):
+class CalendarHome(CommonHome):
     implements(ICalendarHome)
 
     _topPath = "calendars"
     _notifierPrefix = "CalDAV"
 
     def __init__(self, uid, path, calendarStore, transaction, notifiers):
-        super(CalendarHome, self).__init__(uid, path, calendarStore, transaction, notifiers)
+        super(CalendarHome, self).__init__(uid, path, calendarStore,
+                                           transaction, notifiers)
 
         self._childClass = Calendar
 
 
+    def quotaAllowedBytes(self):
+        return self._transaction.store().quota
+
+
     createCalendarWithName = CommonHome.createChildWithName
     removeCalendarWithName = CommonHome.removeChildWithName
 

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:45:58 UTC (rev 7626)
+++ CalendarServer/branches/users/glyph/quota/txdav/caldav/datastore/sql.py	2011-06-20 18:46:10 UTC (rev 7627)
@@ -67,7 +67,7 @@
 from twext.enterprise.dal.syntax import utcNowSQL
 from twext.enterprise.dal.syntax import Len
 
-from txdav.caldav.datastore.util import CalendarObjectBase, CalendarHomeBase
+from txdav.caldav.datastore.util import CalendarObjectBase
 from txdav.caldav.icalendarstore import QuotaExceeded
 
 from txdav.caldav.datastore.util import StorageTransportBase
@@ -79,7 +79,7 @@
 
 from zope.interface.declarations import implements
 
-class CalendarHome(CommonHome, CalendarHomeBase):
+class CalendarHome(CommonHome):
 
     implements(ICalendarHome)
 
@@ -107,6 +107,11 @@
         super(CalendarHome, self).__init__(transaction, ownerUID, notifiers)
         self._shares = SQLLegacyCalendarShares(self)
 
+
+    def quotaAllowedBytes(self):
+        return self._txn.store().quota
+
+
     createCalendarWithName = CommonHome.createChildWithName
     removeCalendarWithName = CommonHome.removeChildWithName
     calendarWithName = CommonHome.childWithName

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:45:58 UTC (rev 7626)
+++ CalendarServer/branches/users/glyph/quota/txdav/caldav/datastore/util.py	2011-06-20 18:46:10 UTC (rev 7627)
@@ -220,21 +220,6 @@
     # 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/80d7fcf3/attachment-0001.html>


More information about the calendarserver-changes mailing list