[Scons-dev] Builder issue
tshortik at gmx.de
Tue Nov 26 17:59:13 EST 2013
On 26.11.2013 21:17, Neven Klacar wrote:
> In the builder I created a an emitter which modifies the target files
> to have a different name.
> def my_emitter(target, source, env):
> for t in target:
> t.name <http://t.name>=t.name
> return (target,source)
I don't know where you got this syntax from (UserGuide? MAN page?
Google?), but usually SCons Nodes don't have an attribute "name". This
may be the problem why your current code doesn't work as expected.
In an Emitter you're allowed to return simple strings as target/source
list, they get converted back to File Nodes by SCons automatically.
So, in your case you could write something like:
def my_emitter(target, source, env):
altered_targets = 
for t in target:
fpath, fext = os.path.splitext(str(t))
Note how I convert the File Node to a simple string with the str()
function, and then create the new filename from it.
Hope this helps you a little further.
Finally, please ask similar questions on our User mailing list
(scons-users at scons.org) in the future. You'll reach much more people
there, and get a response much quicker than in this list, where only
SCons developers are listening.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Scons-dev