[CMF-checkins] CVS: CMF/CMFSetup - context.py:1.12
interfaces.py:1.14
Tres Seaver
tseaver at zope.com
Tue Jul 20 17:53:51 EDT 2004
Update of /cvs-repository/CMF/CMFSetup
In directory cvs.zope.org:/tmp/cvs-serv13231
Modified Files:
context.py interfaces.py
Log Message:
- Normalize timestamp semantics for getLastModified.
=== CMF/CMFSetup/context.py 1.11 => 1.12 ===
--- CMF/CMFSetup/context.py:1.11 Tue Jul 20 12:13:52 2004
+++ CMF/CMFSetup/context.py Tue Jul 20 17:53:20 2004
@@ -14,6 +14,7 @@
from Acquisition import Implicit
from Acquisition import aq_inner
from Acquisition import aq_parent
+from DateTime.DateTime import DateTime
from Globals import InitializeClass
from OFS.DTMLDocument import DTMLDocument
from OFS.Folder import Folder
@@ -87,7 +88,7 @@
if not os.path.exists( full_path ):
return None
- return os.path.getmtime( full_path )
+ return DateTime( os.path.getmtime( full_path ) )
security.declareProtected( ManagePortal, 'isDirectory' )
def isDirectory( self, path ):
@@ -368,9 +369,11 @@
object = snapshot._getOb( filename )
except ( AttributeError, KeyError ):
return None
- else:
- # XXX: this API may not be general enough for all objects.
+
+ try:
return object.read()
+ except AttributeError:
+ return object.manage_FTPget()
security.declareProtected( ManagePortal, 'getLastModified' )
def getLastModified( self, path ):
=== CMF/CMFSetup/interfaces.py 1.13 => 1.14 ===
--- CMF/CMFSetup/interfaces.py:1.13 Tue Jul 20 12:13:52 2004
+++ CMF/CMFSetup/interfaces.py Tue Jul 20 17:53:20 2004
@@ -45,6 +45,8 @@
""" Return the modification timestamp of the item at 'path'.
+ o Result will be a DateTime instance.
+
o Search profiles in the configuration in order.
o If the context is filesystem based, return the 'stat' timestamp
More information about the CMF-checkins
mailing list