- Fix use of CPPDEFINES with C++ source files.
+ - Fix env.Append() when the operand is an object with a __cmp__()
+ method (like a Scanner instance).
+
From Gary Oberbrunner:
- Fix how the man page un-indents after examples in some browsers.
self._dict[key] = kw[key]
elif SCons.Util.is_List(self._dict[key]) and not \
SCons.Util.is_List(kw[key]):
- if not kw[key] is None and kw[key] != '':
+ if kw[key]:
self._dict[key] = self._dict[key] + [ kw[key] ]
+ #self._dict[key] = map(None, self._dict[key] + [ kw[key] ])
elif SCons.Util.is_List(kw[key]) and not \
SCons.Util.is_List(self._dict[key]):
- if self._dict[key] is None or self._dict[key] == '':
- self._dict[key] = kw[key]
- else:
+ if self._dict[key]:
self._dict[key] = [ self._dict[key] ] + kw[key]
+ else:
+ self._dict[key] = kw[key]
+ #self._dict[key] = map(None, self._dict[key] + [ kw[key] ])
elif SCons.Util.is_Dict(self._dict[key]) and \
SCons.Util.is_Dict(kw[key]):
self._dict[key].update(kw[key])
b1 = Environment()['BUILDERS']
b2 = Environment()['BUILDERS']
assert b1 == b2, diff_dict(b1, b2)
-
+
import UserList
UL = UserList.UserList
env1 = Environment(AAA = 'a',
assert env1['QQQ2'] == UL(['', 'Q2']), env1['QQQ2']
assert env1['QQQ3'] == UL(['', 'Q3']), env1['QQQ3']
+ class C:
+ def __init__(self, name):
+ self.name = name
+ def __str__(self):
+ return self.name
+ def __cmp__(self, other):
+ raise "should not compare"
+
+ ccc = C('ccc')
+
+ env2 = Environment(CCC1 = ['c1'], CCC2 = ccc)
+ env2.Append(CCC1 = ccc, CCC2 = ['c2'])
+ assert env2['CCC1'][0] == 'c1', env2['CCC1']
+ assert env2['CCC1'][1] is ccc, env2['CCC1']
+ assert env2['CCC2'][0] is ccc, env2['CCC2']
+ assert env2['CCC2'][1] == 'c2', env2['CCC2']
+
env3 = Environment(X = {'x1' : 7})
env3.Append(X = {'x1' : 8, 'x2' : 9}, Y = {'y1' : 10})
assert env3['X'] == {'x1': 8, 'x2': 9}, env3['X']
argument = None,
skeys = ['.k2'])
-scanners = Environment().Dictionary('SCANNERS')
-env = Environment(SCANNERS = scanners + [kscan, k2scan])
+env = Environment()
+env.Append(SCANNERS = kscan)
+env.Append(SCANNERS = [k2scan])
env.Command('foo', 'foo.k', r'%s build.py $SOURCES $TARGET')