[Zope-CVS] CVS: Products/Ape/lib/apelib/fs - connection.py:1.2
Shane Hathaway
shane@zope.com
Mon, 21 Apr 2003 13:26:34 -0400
Update of /cvs-repository/Products/Ape/lib/apelib/fs
In directory cvs.zope.org:/tmp/cvs-serv20507
Modified Files:
connection.py
Log Message:
Made getModTime() check the last mod time of all files that represent
an object.
=== Products/Ape/lib/apelib/fs/connection.py 1.1 => 1.2 ===
--- Products/Ape/lib/apelib/fs/connection.py:1.1 Wed Apr 9 23:09:55 2003
+++ Products/Ape/lib/apelib/fs/connection.py Mon Apr 21 13:26:33 2003
@@ -249,11 +249,26 @@
def getModTime(self, subpath, default=0):
+ """Returns the time an object was last modified.
+
+ Since objects are split into up to three files, this
+ implementation returns the modification time of the most
+ recently modified of the three.
+ """
path = self._expandPath(subpath)
- try:
- return os.path.getmtime(path)
- except OSError:
- return default
+ props, remainder = self._getPropertyPaths(path)
+ maxtime = -1
+ for p in (path, props, remainder):
+ try:
+ t = os.path.getmtime(p)
+ except OSError:
+ pass
+ else:
+ if t > maxtime:
+ maxtime = t
+ if maxtime == -1:
+ maxtime = default
+ return maxtime
def _getPropertyPaths(self, path):