[CalendarServer-changes] [6132] CalendarServer/trunk/txdav/common/datastore/file.py

source_changes at macosforge.org source_changes at macosforge.org
Thu Aug 19 11:08:20 PDT 2010


Revision: 6132
          http://trac.macosforge.org/projects/calendarserver/changeset/6132
Author:   glyph at apple.com
Date:     2010-08-19 11:08:19 -0700 (Thu, 19 Aug 2010)
Log Message:
-----------
fix file-backed INotificationObject.modified to make tests pass.

Modified Paths:
--------------
    CalendarServer/trunk/txdav/common/datastore/file.py

Modified: CalendarServer/trunk/txdav/common/datastore/file.py
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/file.py	2010-08-19 17:50:42 UTC (rev 6131)
+++ CalendarServer/trunk/txdav/common/datastore/file.py	2010-08-19 18:08:19 UTC (rev 6132)
@@ -14,7 +14,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 ##
-from txcaldav.calendarstore.util import SyncTokenHelper
 
 """
 Common utility functions for a file based datastore.
@@ -44,6 +43,8 @@
 from txdav.propertystore.base import PropertyName
 from txdav.propertystore.xattr import PropertyStore
 
+from txcaldav.calendarstore.util import SyncTokenHelper
+
 from errno import EEXIST, ENOENT
 from zope.interface import implements, directlyProvides
 
@@ -807,7 +808,7 @@
         self._objectResourceClass = NotificationObject
 
     def resourceType(self):
-        return ResourceType.notification
+        return ResourceType.notification #@UndefinedVariable
 
     notificationObjects = CommonHomeChild.objectResources
     listNotificationObjects = CommonHomeChild.listObjectResources
@@ -867,6 +868,13 @@
         super(NotificationObject, self).__init__(name, notifications)
 
 
+    def modified(self):
+        if not self._path.exists():
+            from twisted.internet import reactor
+            return int(reactor.seconds())
+        return super(NotificationObject, self).modified()
+
+
     @property
     def _notificationCollection(self):
         return self._parentCollection
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100819/06c3911f/attachment.html>


More information about the calendarserver-changes mailing list