matching source and target's behavior between func and cmd actions

daggs <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <trinity-043d0e9b-3f76-436e-8d03-e740fecd069a-1592644744958@3c-app-mailcom-bs02>
Greetings.

given this example:
def task(source, target, env):
	print('S1: %s T1: %s' % (source[0], target[0]))

bld = Builder(action = '@echo S: $SOURCES.abspath T: $TARGET.abspath')
bld1 = Builder(action = task)

env = Environment(BUILDERS = {'Foo' : bld, 'Foo1' : bld1})

env.Foo('a/vb/c/aaa',['/dev/null','v','b'])
env.Foo1('a/vb/c/aaa1',['/dev/null','v','b'])

which produces this output:
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
S: /dev/null /tmp/test/v /tmp/test/b T: /tmp/test/a/vb/c/aaa
task(["a/vb/c/aaa1"], ["/dev/null", "v", "b"])
S1: /dev/null T1: a/vb/c/aaa1
scons: done building targets.

is there a simple way to change bld1 to behave the same as bld?
I'd assume this can be done using **kwargs but it seems like it won't be simple

Thanks,

Dagg.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.