From da655cf7ce87bcf3d1efde51358b0f1463131f74 Mon Sep 17 00:00:00 2001 From: Steven Knight Date: Mon, 15 Oct 2001 16:00:52 +0000 Subject: Remove the Node.derived attribute. --- src/engine/SCons/Builder.py | 1 - src/engine/SCons/BuilderTests.py | 3 +-- src/engine/SCons/EnvironmentTests.py | 2 +- src/engine/SCons/Node/__init__.py | 4 ++-- src/engine/SCons/Sig/SigTests.py | 6 +++--- src/engine/SCons/Sig/__init__.py | 4 ++-- src/script/scons.py | 2 +- 7 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/engine/SCons/Builder.py b/src/engine/SCons/Builder.py index dc2566f..1f4f555 100644 --- a/src/engine/SCons/Builder.py +++ b/src/engine/SCons/Builder.py @@ -95,7 +95,6 @@ class BuilderBase: for t in tlist: t.builder_set(self) t.env_set(env) - t.derived = 1 t.add_source(slist) if len(tlist) == 1: diff --git a/src/engine/SCons/BuilderTests.py b/src/engine/SCons/BuilderTests.py index 0352894..e84799a 100644 --- a/src/engine/SCons/BuilderTests.py +++ b/src/engine/SCons/BuilderTests.py @@ -68,7 +68,7 @@ class BuilderTestCase(unittest.TestCase): def __init__(self, name): self.name = name self.sources = [] - self.derived = 0 + self.builder = None def __str__(self): return self.name def builder_set(self, builder): @@ -84,7 +84,6 @@ class BuilderTestCase(unittest.TestCase): assert n1.env == env assert n1.builder == builder assert n1.sources == [n2] - assert n1.derived == 1 def test_action(self): """Test Builder creation diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py index 66d64a0..b15b193 100644 --- a/src/engine/SCons/EnvironmentTests.py +++ b/src/engine/SCons/EnvironmentTests.py @@ -175,7 +175,7 @@ class EnvironmentTestCase(unittest.TestCase): env = Environment() t = env.Command(target='foo.out', source=['foo1.in', 'foo2.in'], action='buildfoo $target $source') - assert t.derived + assert t.builder assert t.builder.action.__class__.__name__ == 'CommandAction' assert t.builder.action.command == 'buildfoo $target $source' assert 'foo1.in' in map(lambda x: x.path, t.sources) diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py index 8334d2d..d6553e5 100644 --- a/src/engine/SCons/Node/__init__.py +++ b/src/engine/SCons/Node/__init__.py @@ -51,12 +51,12 @@ class Node: def __init__(self): self.sources = [] self.depends = [] - self.derived = 0 + self.builder = None self.env = None self.state = None def build(self): - if not hasattr(self, "builder"): + if not self.builder: return None sources_str = string.join(map(lambda x: str(x), self.sources)) stat = self.builder.execute(env = self.env.Dictionary(), diff --git a/src/engine/SCons/Sig/SigTests.py b/src/engine/SCons/Sig/SigTests.py index de8d6e6..77a8a16 100644 --- a/src/engine/SCons/Sig/SigTests.py +++ b/src/engine/SCons/Sig/SigTests.py @@ -33,11 +33,11 @@ import sys class DummyFile: """A class that simulates a file for testing purposes""" - def __init__(self, path, contents, timestamp, derived): + def __init__(self, path, contents, timestamp, builder): self.path = path self.contents = contents self.timestamp = timestamp - self.derived = derived + self.builder = builder def modify(self, contents, timestamp): self.contents = contents @@ -49,7 +49,7 @@ class DummyNode: def __init__(self, file): self.file = file self.path = file.path - self.derived = file.derived + self.builder = file.builder self.depends = [] def get_contents(self): diff --git a/src/engine/SCons/Sig/__init__.py b/src/engine/SCons/Sig/__init__.py index 964a329..869cf85 100644 --- a/src/engine/SCons/Sig/__init__.py +++ b/src/engine/SCons/Sig/__init__.py @@ -147,7 +147,7 @@ class Calculator: if node.has_signature(): sig = node.get_signature() - elif node.derived: + elif node.builder: signatures = {} self.collect(node, signatures) signatures = filter(lambda x: not x is None, signatures.values()) @@ -192,7 +192,7 @@ class Calculator: newtime = node.get_timestamp() - if not node.derived and newtime == oldtime: + if not node.builder and newtime == oldtime: newsig = oldsig else: newsig = self.signature(node) diff --git a/src/script/scons.py b/src/script/scons.py index 1a67e51..b8dc2ff 100644 --- a/src/script/scons.py +++ b/src/script/scons.py @@ -68,7 +68,7 @@ class BuildTask(SCons.Taskmaster.Task): class CleanTask(SCons.Taskmaster.Task): """An SCons clean task.""" def execute(self): - if hasattr(self.target, "builder"): + if self.target.builder: os.unlink(self.target.path) print "Removed " + self.target.path -- cgit v0.12