summaryrefslogtreecommitdiffstats
path: root/src/engine
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/engine
parent0baa34102491423d6707a5becf6b687d851cbbff (diff)
downloadSCons-7511301b4ec23b6b54647ae55368aee2e136518a.zip
SCons-7511301b4ec23b6b54647ae55368aee2e136518a.tar.gz
SCons-7511301b4ec23b6b54647ae55368aee2e136518a.tar.bz2
Refactor CompositeBuilder initialization.
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/SCons/Builder.py19
1 files changed, 5 insertions, 14 deletions
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)