Commits

Anonymous committed 3f55db9

Use the module-specific current() function.

  • Participants
  • Parent commits 0b3ef7c

Comments (0)

Files changed (5)

src/engine/SCons/Sig/MD5.py

 import md5
 import string
 
-def current(obj, sig):
-    """Return whether a given object is up-to-date with the
-    specified signature.
+def current(new, old):
+    """Return whether a new signature is up-to-date with
+    respect to an old signature.
     """
-    return obj.get_signature() == sig
+    return new == old
 
 def hexdigest(s):
     """Return a signature as a string of hex characters.

src/engine/SCons/Sig/MD5Tests.py

 	Simple comparison of different "signature" values.
 	"""
 	obj = my_obj('111')
-	assert not current(obj, signature(my_obj('110')))
-	assert     current(obj, signature(my_obj('111')))
-	assert not current(obj, signature(my_obj('112')))
+	assert not current(obj.get_signature(), signature(my_obj('110')))
+	assert     current(obj.get_signature(), signature(my_obj('111')))
+	assert not current(obj.get_signature(), signature(my_obj('112')))
 
     def test_collect(self):
 	"""Test collecting a list of signatures into a new signature value

src/engine/SCons/Sig/TimeStamp.py

 
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
-def current(obj, sig):
-    """Return whether the objects timestamp is up-to-date.
+def current(new, old):
+    """Return whether a new timestamp is up-to-date with
+    respect to an old timestamp.
     """
-    return obj.get_signature() >= sig
+    return not old is None and new <= old
 
 def collect(signatures):
     """

src/engine/SCons/Sig/TimeStampTests.py

 	Simple comparison of different timestamp values.
 	"""
 	o1 = my_obj(value = 111)
-	assert current(o1, 110)
-	assert current(o1, 111)
-	assert not current(o1, 112)
+	assert not current(o1.get_signature(), 110)
+	assert current(o1.get_signature(), 111)
+	assert current(o1.get_signature(), 112)
 
     def test_collect(self):
 	"""Test collecting a list of signatures into a new signature value

src/engine/SCons/Sig/__init__.py

         else:
             newsig = self.signature(node)
         
-        return newsig == oldsig
+        return self.module.current(newsig, oldsig)
 
     def write(self, nodes):
         """