[Scons-users] Emiter usage

Dirk Bächle tshortik at gmx.de
Wed Sep 21 03:04:56 EDT 2016


Hi Pholat,

On 21.09.2016 08:41, pholat wrote:
> So you say python scripts are not parsed? Thats kind of new...
>

no, sorry that's not what Bill said. He said:

>
>     Adam,
>
>     SCons files are not parsed, they are run by python.
>     They are python scripts.
>

meaning that "SCons build description files" (SConsctructs/SConscripts) aren't parsed and interpreted separately as if "SCons"ish 
would be another programming language. The sentence "They *are* Python scripts" especially refers to your doubts about whether 
things will work as expected when mixing SCons methods and constructs with a basic Python for loop:

>
>     On Tue, Sep 20, 2016 at 2:02 AM, pholat <pholat at gmail.com <mailto:pholat at gmail.com>> wrote:
>
>         Hi,
>
>         I wasn't sure if when I run SConscript(...) in for loop dependencies will be intact. As dependency check is not sequential
>         and I do not know how SCons files are parsed on 'scons' call.
>

Just like any standard Python script, an SConstruct/SConscript is directly run through the Python interpreter (using the 
execstack)...which of course includes the internal type of parsing that the interpreter has to do for any script. But there is no 
special SCons syntax to take into account, so all the standard Python paradigms from "if-then-else" up to "metaclasses" will simply 
work as expected.

Sorry for the confusion, I hope we're all on the same page now.

Best regards,

Dirk



More information about the Scons-users mailing list