[CalendarServer-changes] [2438] CalendarServer/trunk/twistedcaldav

source_changes at macosforge.org source_changes at macosforge.org
Wed May 21 14:15:48 PDT 2008


Revision: 2438
          http://trac.macosforge.org/projects/calendarserver/changeset/2438
Author:   dreid at apple.com
Date:     2008-05-21 14:15:34 -0700 (Wed, 21 May 2008)

Log Message:
-----------
Update cache to handle the two hashed subdirectories

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/cache.py
    CalendarServer/trunk/twistedcaldav/test/test_cache.py

Modified: CalendarServer/trunk/twistedcaldav/cache.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/cache.py	2008-05-21 02:08:49 UTC (rev 2437)
+++ CalendarServer/trunk/twistedcaldav/cache.py	2008-05-21 21:15:34 UTC (rev 2438)
@@ -99,9 +99,14 @@
 
 
         fp = self._docroot
-        for childPath in uri.split('/')[:4]:
+        segments = uri.split('/')
+        for childPath in segments[:3]:
             fp = fp.child(childPath)
 
+        fp = fp.child(segments[3][:2]
+                      ).child(segments[3][2:4]
+                              ).child(segments[3])
+
         props = self.propertyStoreFactory(__FauxStaticResource(fp))
 
         try:

Modified: CalendarServer/trunk/twistedcaldav/test/test_cache.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/test/test_cache.py	2008-05-21 02:08:49 UTC (rev 2437)
+++ CalendarServer/trunk/twistedcaldav/test/test_cache.py	2008-05-21 21:15:34 UTC (rev 2438)
@@ -221,7 +221,11 @@
 
     def test__tokenForURI(self):
         docroot = FilePath(self.mktemp())
-        principal = docroot.child('principals').child('users').child('wsanchez')
+        principal = docroot.child('principals'
+                          ).child('users'
+                          ).child('ws'
+                          ).child('an'
+                          ).child('wsanchez')
 
         expected_token = "wsanchezToken0"
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20080521/fcfa140b/attachment.htm 


More information about the calendarserver-changes mailing list