[CalendarServer-changes] [5552] CalendarServer/branches/users/wsanchez/transations
source_changes at macosforge.org
source_changes at macosforge.org
Sun May 2 14:32:59 PDT 2010
Revision: 5552
http://trac.macosforge.org/projects/calendarserver/changeset/5552
Author: glyph at apple.com
Date: 2010-05-02 14:32:58 -0700 (Sun, 02 May 2010)
Log Message:
-----------
Don't accidentally export / import base FilePath name; pacify tests wrt. moveTo destination.changed().
Modified Paths:
--------------
CalendarServer/branches/users/wsanchez/transations/twext/python/filepath.py
CalendarServer/branches/users/wsanchez/transations/txdav/propertystore/test/test_xattr.py
Modified: CalendarServer/branches/users/wsanchez/transations/twext/python/filepath.py
===================================================================
--- CalendarServer/branches/users/wsanchez/transations/twext/python/filepath.py 2010-04-30 16:44:31 UTC (rev 5551)
+++ CalendarServer/branches/users/wsanchez/transations/twext/python/filepath.py 2010-05-02 21:32:58 UTC (rev 5552)
@@ -31,14 +31,14 @@
from types import FunctionType, MethodType
from errno import EINVAL
-from twisted.python.filepath import FilePath
+from twisted.python.filepath import FilePath as _FilePath
from stat import S_ISDIR
-class CachingFilePath(FilePath, object):
+class CachingFilePath(_FilePath, object):
"""
- A descendent of L{twisted.python.filepath.FilePath} which implements a more
- aggressive caching policy.
+ A descendent of L{_FilePath} which implements a more aggressive caching
+ policy.
"""
_listdir = _listdir # integration points for tests
@@ -56,11 +56,11 @@
@property
def siblingExtensionSearch(self):
"""
- Dynamically create a version of L{FilePath.siblingExtensionSearch} that
+ Dynamically create a version of L{_FilePath.siblingExtensionSearch} that
uses a pluggable 'listdir' implementation.
"""
return MethodType(FunctionType(
- FilePath.siblingExtensionSearch.im_func.func_code,
+ _FilePath.siblingExtensionSearch.im_func.func_code,
{'listdir': self._retryListdir,
'basename': _basename,
'dirname': _dirname,
@@ -121,17 +121,19 @@
def moveTo(self, destination, followLinks=True):
"""
- Override L{FilePath.moveTo}, updating extended cache information if
+ Override L{_FilePath.moveTo}, updating extended cache information if
necessary.
"""
result = super(CachingFilePath, self).moveTo(destination, followLinks)
self.changed()
- destination.changed()
+ # Work with vanilla FilePath destinations to pacify the tests.
+ if hasattr(destination, "changed"):
+ destination.changed()
def remove(self):
"""
- Override L{FilePath.remove}, updating extended cache information if
+ Override L{_FilePath.remove}, updating extended cache information if
necessary.
"""
try:
Modified: CalendarServer/branches/users/wsanchez/transations/txdav/propertystore/test/test_xattr.py
===================================================================
--- CalendarServer/branches/users/wsanchez/transations/txdav/propertystore/test/test_xattr.py 2010-04-30 16:44:31 UTC (rev 5551)
+++ CalendarServer/branches/users/wsanchez/transations/txdav/propertystore/test/test_xattr.py 2010-05-02 21:32:58 UTC (rev 5552)
@@ -18,7 +18,7 @@
Property store tests.
"""
-from twext.python.filepath import FilePath
+from twext.python.filepath import CachingFilePath as FilePath
from txdav.propertystore.base import PropertyName
from txdav.propertystore.test.base import propertyName
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100502/c7185e4d/attachment.html>
More information about the calendarserver-changes
mailing list