summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2002-01-03 00:21:31 (GMT)
committerSteven Knight <knight@baldmt.com>2002-01-03 00:21:31 (GMT)
commit7511301b4ec23b6b54647ae55368aee2e136518a (patch)
tree8d166ba800dc3dcd34e30a2a293039b9d1013c19 /src
parent0baa34102491423d6707a5becf6b687d851cbbff (diff)
downloadSCons-7511301b4ec23b6b54647ae55368aee2e136518a.zip
SCons-7511301b4ec23b6b54647ae55368aee2e136518a.tar.gz
SCons-7511301b4ec23b6b54647ae55368aee2e136518a.tar.bz2
Refactor CompositeBuilder initialization.
Diffstat (limited to 'src')
-rw-r--r--src/CHANGES.txt3
-rw-r--r--src/engine/SCons/Builder.py19
2 files changed, 8 insertions, 14 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index dfcf395..45e5f2b 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -19,6 +19,9 @@ RELEASE 0.03 -
as separate file names, allowing prefixes and suffixes to be appended
to each individually.
+ - Refactor to move CompositeBuilder initialization logic from the
+ factory wrapper to the __init__() method.
+
From Anthony Roach:
- Add a "duplicate" keyword argument to BuildDir() that can be set
diff --git a/src/engine/SCons/Builder.py b/src/engine/SCons/Builder.py
index eceb66a..27d93e9 100644
--- a/src/engine/SCons/Builder.py
+++ b/src/engine/SCons/Builder.py
@@ -126,15 +126,6 @@ def Builder(**kw):
return apply(MultiStepBuilder, (), kw)
elif kw.has_key('action') and (type(kw['action']) is types.DictType or
isinstance(kw['action'], UserDict)):
- action_dict = kw['action']
- builders = []
- for suffix, action in action_dict.items():
- bld_kw = kw.copy()
- bld_kw['action'] = action
- bld_kw['src_suffix'] = suffix
- builders.append(apply(BuilderBase, (), bld_kw))
- del kw['action']
- kw['builders'] = builders
return apply(CompositeBuilder, (), kw)
else:
return apply(BuilderBase, (), kw)
@@ -279,14 +270,14 @@ class CompositeBuilder(BuilderBase):
def __init__(self, name = None,
prefix='',
suffix='',
- builders=[]):
+ action = {}):
BuilderBase.__init__(self, name=name, prefix=prefix,
suffix=suffix)
self.builder_dict = {}
- for bld in builders:
- if not bld.src_suffix:
- raise InternalError, "All builders supplied to CompositeBuilder class must have a src_suffix."
- self.builder_dict[bld.src_suffix] = bld
+ for suff, act in action.items():
+ self.builder_dict[suff] = BuilderBase(name = name,
+ action = act,
+ src_suffix = suff)
def __call__(self, env, target = None, source = None):
ret = BuilderBase.__call__(self, env, target=target, source=source)