summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-06-02 05:34:57 (GMT)
committerSteven Knight <knight@baldmt.com>2004-06-02 05:34:57 (GMT)
commitf0eef8baab59eaf981656f5507f17c83ee096a0a (patch)
treef4275d1ccea514965b71d4bbd739022b799ddf02 /src
parent094a011d49d4ba19f276983d848cf93bfc951b41 (diff)
downloadSCons-f0eef8baab59eaf981656f5507f17c83ee096a0a.zip
SCons-f0eef8baab59eaf981656f5507f17c83ee096a0a.tar.gz
SCons-f0eef8baab59eaf981656f5507f17c83ee096a0a.tar.bz2
Make the use of the calc argument in Node methods consistent.
Diffstat (limited to 'src')
-rw-r--r--src/engine/SCons/Node/FS.py10
-rw-r--r--src/engine/SCons/Node/Python.py2
-rw-r--r--src/engine/SCons/Node/__init__.py15
-rw-r--r--src/engine/SCons/Taskmaster.py2
-rw-r--r--src/engine/SCons/TaskmasterTests.py9
5 files changed, 25 insertions, 13 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py
index 50b725b..23cf8a7 100644
--- a/src/engine/SCons/Node/FS.py
+++ b/src/engine/SCons/Node/FS.py
@@ -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
diff --git a/src/engine/SCons/Node/Python.py b/src/engine/SCons/Node/Python.py
index e15888b..28ff674 100644
--- a/src/engine/SCons/Node/Python.py
+++ b/src/engine/SCons/Node/Python.py
@@ -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."""
diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py
index 65cb683..ba4cbca 100644
--- a/src/engine/SCons/Node/__init__.py
+++ b/src/engine/SCons/Node/__init__.py
@@ -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.
diff --git a/src/engine/SCons/Taskmaster.py b/src/engine/SCons/Taskmaster.py
index b09a589..7fb94aa 100644
--- a/src/engine/SCons/Taskmaster.py
+++ b/src/engine/SCons/Taskmaster.py
@@ -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)
diff --git a/src/engine/SCons/TaskmasterTests.py b/src/engine/SCons/TaskmasterTests.py
index 5955ecf..ebf0e9c 100644
--- a/src/engine/SCons/TaskmasterTests.py
+++ b/src/engine/SCons/TaskmasterTests.py
@@ -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):