[Checkins] SVN: Products.GenericSetup/trunk/ No longer rely on `bobobase_modification_time`

Hanno Schlichting hannosch at hannosch.eu
Sun Jul 3 10:36:46 EDT 2011


Log message for revision 122081:
  No longer rely on `bobobase_modification_time`
  

Changed:
  U   Products.GenericSetup/trunk/Products/GenericSetup/context.py
  U   Products.GenericSetup/trunk/Products/GenericSetup/tests/test_context.py
  U   Products.GenericSetup/trunk/Products/GenericSetup/tests/test_differ.py
  U   Products.GenericSetup/trunk/docs/CHANGES.rst

-=-
Modified: Products.GenericSetup/trunk/Products/GenericSetup/context.py
===================================================================
--- Products.GenericSetup/trunk/Products/GenericSetup/context.py	2011-07-03 14:19:26 UTC (rev 122080)
+++ Products.GenericSetup/trunk/Products/GenericSetup/context.py	2011-07-03 14:36:45 UTC (rev 122081)
@@ -640,7 +640,13 @@
         except ( AttributeError, KeyError ):
             return None
         else:
-            return object.bobobase_modification_time()
+            mtime = getattr(object, '_p_mtime', None)
+            if mtime is None:
+                # test hook
+                mtime = getattr(object, '_faux_mod_time', None)
+                if mtime is None:
+                    return DateTime()
+            return DateTime(mtime)
 
     security.declareProtected( ManagePortal, 'isDirectory' )
     def isDirectory( self, path ):

Modified: Products.GenericSetup/trunk/Products/GenericSetup/tests/test_context.py
===================================================================
--- Products.GenericSetup/trunk/Products/GenericSetup/tests/test_context.py	2011-07-03 14:19:26 UTC (rev 122080)
+++ Products.GenericSetup/trunk/Products/GenericSetup/tests/test_context.py	2011-07-03 14:36:45 UTC (rev 122081)
@@ -1121,13 +1121,9 @@
         folder._setObject( filename, file )
 
         if mod_time is not None:
+            mod_time = DateTime(mod_time).timeTime()
+            folder._faux_mod_time = file._faux_mod_time = mod_time
 
-            def __faux_mod_time():
-                return DateTime(mod_time)
-
-            folder.bobobase_modification_time = \
-            file.bobobase_modification_time = __faux_mod_time
-
         return folder._getOb( filename )
 
     def test_getLogger( self ):

Modified: Products.GenericSetup/trunk/Products/GenericSetup/tests/test_differ.py
===================================================================
--- Products.GenericSetup/trunk/Products/GenericSetup/tests/test_differ.py	2011-07-03 14:19:26 UTC (rev 122080)
+++ Products.GenericSetup/trunk/Products/GenericSetup/tests/test_differ.py	2011-07-03 14:36:45 UTC (rev 122081)
@@ -166,13 +166,8 @@
         folder._setObject( filename, file )
 
         if mod_time is not None:
+            folder._faux_mod_time = file._faux_mod_time = mod_time
 
-            def __faux_mod_time():
-                return mod_time
-
-            folder.bobobase_modification_time = \
-            file.bobobase_modification_time = __faux_mod_time
-
         return folder._getOb( filename )
 
     def test_compare_empties( self ):

Modified: Products.GenericSetup/trunk/docs/CHANGES.rst
===================================================================
--- Products.GenericSetup/trunk/docs/CHANGES.rst	2011-07-03 14:19:26 UTC (rev 122080)
+++ Products.GenericSetup/trunk/docs/CHANGES.rst	2011-07-03 14:36:45 UTC (rev 122081)
@@ -4,6 +4,8 @@
 1.6.4 (unreleased)
 ------------------
 
+- No longer rely on `bobobase_modification_time`.
+
 - TarballImportContext: Fixed type of 'getLastModified' return value.
 
 - LP #388380:  added docstrings to



More information about the checkins mailing list