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."""
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
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.
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
return csig
- def current(self, calc):
+ def current(self, calc=None):
self.binfo = self.gen_binfo(calc)
if self.always_build:
return None
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."""
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.
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.
what's wanted.
"""
+ if calc is None:
+ calc = self.calculator()
+
binfo = self.new_binfo()
self.scan()
except AttributeError:
pass
- def calc_csig(self, calc):
+ def calc_csig(self, calc=None):
try:
binfo = self.binfo
except AttributeError:
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
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.
"""
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)
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
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):