[Scons-users] A quick doubt about Command()

Matias Iturburu matias.iturburu at tallertechnologies.com
Mon Nov 11 08:57:16 EST 2013


Hello list.

I'm writing a builder that runs astyle on a temporary file and prints the
diff with the original out to the standard output.

I have some concerns about what would be the "proper" way to deal with
according to SCons.

Basically, the process happens in three steps:

- Run astyle and output the result to a temprorary file.
- Run diff of *original_file* and *astyled_file.*
*- *Print the diff.

As the process has no other output that the printed strings I think this is
a job for a Pseudo Builder (
http://www.scons.org/doc/2.3.0/HTML/scons-user.html#chap-add-method).

So I can do a *_do_astyle*,* _do_astyle_diff* and run the correspondent
eternal tool in each. This is what brings me here: Should this external
tool be run using the Command (
http://www.scons.org/doc/2.3.0/HTML/scons-user.html#chap-builders-commands)
function? Is this Command executed right away? Is this some sort of
replacement for subprocess.Popen (
http://docs.python.org/2/library/subprocess.html?highlight=popen#subprocess.Popen
)?

I bring this out because I recall having being told that if I'm running
Popen in a builder maybe I'm doing something wrong.

Thanks in advance.


--
<http://www.tallertechnologies.com>
Matías Iturburu
Software Engineer




*San Lorenzo 47, 3rd Floor, Office 5 Córdoba, Argentina *

*Phone: +54 351 4217888 / +54 351 4218211 Skype: matias.iturburu*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20131111/555dcaf6/attachment.html


More information about the Scons-users mailing list