[Scons-users] using scons api without invoking main "scons" executable

William Deegan bill at baddogconsulting.com
Sun Jun 2 11:47:27 EDT 2013


Karl,

Several people have asked this before, however we don't currently support such.
The internal API's are subject to change without notice.
That said they've been fairly stable for a while.
But we do plan some major refactoring of internals going forward.

-Bill
Co-Manager SCons Project
On Jun 1, 2013, at 5:06 PM, Karl Ostmo <kostmo at gmail.com> wrote:


> Could the installed SCons Python modules be used to query a dependency

> tree programmatically, without executing the main "scons" program?

>

> I started with a script like this:

>

>>>>>> BEGIN SCRIPT

> import sys, os

> sys.path.append( os.path.expanduser("~/Downloads/scons-2.1.0/engine") )

>

> import SCons.Node.FS

> import SCons.Script.SConscript

>

> fs = SCons.Node.FS.get_default_fs()

> toplevel_script_filename = "SConstruct"

> SCons.Script.SConscript.SConscript(fs, toplevel_script_filename)

> <<<<< END SCRIPT

>

> The above snippet produces this error:

> AttributeError: 'DefaultEnvironmentCall' object has no attribute 'SConscript'

>

> My goal is to write a frontend to display which files in our

> repository are in use as dependencies vs. cruft.

> _______________________________________________

> Scons-users mailing list

> Scons-users at scons.org

> http://four.pairlist.net/mailman/listinfo/scons-users




More information about the Scons-users mailing list