Make the use of the calc argument in Node methods consistent.
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Wed, 2 Jun 2004 05:34:57 +0000 (05:34 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Wed, 2 Jun 2004 05:34:57 +0000 (05:34 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@991 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/engine/SCons/Node/FS.py
src/engine/SCons/Node/Python.py
src/engine/SCons/Node/__init__.py
src/engine/SCons/Taskmaster.py
src/engine/SCons/TaskmasterTests.py

index 50b725b0b28f206cca19ac7d5bc5421ec85dbc3a..23cf8a7a9ab6a722f56ab35b1fbdb37f4337dab1 100644 (file)
@@ -635,7 +635,7 @@ class Entry(Base):
             self.clear()
             return File.exists(self)
 
-    def calc_signature(self, calc):
+    def calc_signature(self, calc=None):
         """Return the Entry's calculated signature.  Check the file
         system to see what we should turn into first.  Assume a file if
         there's no directory."""
@@ -1259,7 +1259,7 @@ class Dir(Base):
     def prepare(self):
         pass
 
-    def current(self, calc):
+    def current(self, calc=None):
         """If all of our children were up-to-date, then this
         directory was up-to-date, too."""
         state = 0
@@ -1633,7 +1633,7 @@ class File(Base):
         except AttributeError:
             pass
 
-    def calc_csig(self, calc):
+    def calc_csig(self, calc=None):
         """
         Generate a node's content signature, the digested signature
         of its content.
@@ -1642,6 +1642,8 @@ class File(Base):
         cache - alternate node to use for the signature cache
         returns - the content signature
         """
+        if calc is None:
+            calc = self.calculator()
 
         try:
             return self.binfo.csig
@@ -1675,7 +1677,7 @@ class File(Base):
 
         return csig
 
-    def current(self, calc):
+    def current(self, calc=None):
         self.binfo = self.gen_binfo(calc)
         if self.always_build:
             return None
index e15888b23fc8eb8302d8f094a802d0df15255aea..28ff674960a9b63c60ebf9c8f637cdfb7dc71d1b 100644 (file)
@@ -62,7 +62,7 @@ class Value(SCons.Node.Node):
             contents = contents + kid.get_contents()
         return contents
 
-    def calc_csig(self, calc):
+    def calc_csig(self, calc=None):
         """Because we're a Python value node and don't have a real
         timestamp, we get to ignore the calculator and just use the
         value contents."""
index 65cb68326dbbbdc42b67dd5839eb7ff20db687e2..ba4cbca588a1ad2d90f00a691e451518acacde6f 100644 (file)
@@ -464,7 +464,7 @@ class Node:
         env = self.env or SCons.Defaults.DefaultEnvironment()
         return env.get_calculator()
 
-    def calc_signature(self, calc):
+    def calc_signature(self, calc=None):
         """
         Select and calculate the appropriate build signature for a node.
 
@@ -500,14 +500,14 @@ class Node:
         except AttributeError:
             pass
 
-    def calc_bsig(self, calc):
+    def calc_bsig(self, calc=None):
         try:
             return self.binfo.bsig
         except AttributeError:
             self.binfo = self.gen_binfo(calc)
             return self.binfo.bsig
 
-    def gen_binfo(self, calc):
+    def gen_binfo(self, calc=None):
         """
         Generate a node's build signature, the digested signatures
         of its dependency files and build information.
@@ -522,6 +522,9 @@ class Node:
         what's wanted.
         """
 
+        if calc is None:
+            calc = self.calculator()
+
         binfo = self.new_binfo()
 
         self.scan()
@@ -565,7 +568,7 @@ class Node:
         except AttributeError:
             pass
 
-    def calc_csig(self, calc):
+    def calc_csig(self, calc=None):
         try:
             binfo = self.binfo
         except AttributeError:
@@ -573,6 +576,8 @@ class Node:
         try:
             return binfo.csig
         except AttributeError:
+            if calc is None:
+                calc = self.calculator()
             binfo.csig = calc.module.signature(self)
             self.store_info(binfo)
             return binfo.csig
@@ -747,7 +752,7 @@ class Node:
         subtypes are always out of date, so they will always get built."""
         return None
 
-    def children_are_up_to_date(self, calc):
+    def children_are_up_to_date(self, calc=None):
         """Alternate check for whether the Node is current:  If all of
         our children were up-to-date, then this Node was up-to-date, too.
 
index b09a5892261c3257c7986c7282fc0fa97fc83b52..7fb94aa9ffa7d0c0619179610fd04fca6ccb127b 100644 (file)
@@ -192,7 +192,7 @@ class Task:
         """
         self.out_of_date = []
         for t in self.targets:
-            if not t.current(t.calculator()):
+            if not t.current():
                 self.out_of_date.append(t)
         if self.out_of_date:
             self.mark_targets_and_side_effects(SCons.Node.executing)
index 5955ecfdce56bee17ee809488a60bc8c1d2d1fe9..ebf0e9cb4bcd3bdc78ef8ab8d4bef42b71e92bf3 100644 (file)
@@ -45,7 +45,10 @@ class Node:
         self.cached = 0
         self.scanned = 0
         self.scanner = None
-        self.builder = Node.build
+        class Builder:
+            def targets(self, node):
+                return [node]
+        self.builder = Builder()
         self.bsig = None
         self.csig = None
         self.state = None
@@ -137,7 +140,9 @@ class Node:
                 return node._current_val
         return Calc()
 
-    def current(self, calc):
+    def current(self, calc=None):
+        if calc is None:
+            calc = self.calculator()
         return calc.current(self, calc.bsig(self))
     
     def depends_on(self, nodes):