[Scons-users] How to make a builder that takes a list of parameters

Dirk Bächle tshortik at gmx.de
Thu Jun 11 09:36:59 EDT 2015


Hi Bijan,

On 11.06.2015 15:29, Bijan Chokoufe Nejad wrote:
> Hi all,
>
> I have a list of files and a list of descriptions that should be
> compiled together to a plot. So I need something like
>
> cmd file1:desc1 file2:desc2 ...
>
> In an old post, I saw someone using optional arguments for the generator
> like this
>
> def generate_plot(source, target, env, for_signature,
> 		descriptions=None):
>    target_dir = target[0].dir
>    if descriptions is not None:
>      sources = ' '.join([str(s) + ':' + d for (s,d) in
> 		zip(source, descriptions)])
>    else:
>      sources = ' '.join([str(s) for s in source])
>    return plot_cmd + '-o %s %s' % (target_dir, sources)
>
> build_plot = Builder(generator = generate_plot)
>
> But with scons 2.0.1 this doesn't seem to work?!

what exactly did you try to make it work? Which versions of SCons and Python were you using? And what is the exact error message 
that you got?

Best regards,

Dirk



More information about the Scons-users mailing list