On Fri, Sep 4, 2015 at 1:48 PM, Gary Oberbrunner <ga...@oberbrunner.com> wrote: > > On Fri, Sep 4, 2015 at 4:24 AM, anatoly techtonik <techto...@gmail.com> > wrote: > >> On Fri, Sep 4, 2015 at 10:10 AM, Dirk Bächle <tshor...@gmx.de> wrote: >> >>> On 04.09.2015 06:16, anatoly techtonik wrote: >>> >>>> I have another question about SCons. If I specify target explicitly, it >>>> ends up >>>> as str in BUILD_TARGETS and it is impossible to traverse. How do I >>>> transform it to Node if I don't know the type? I.e. how to lookup Node >>>> object >>>> by name? >>>> >>>> >>> you mean you explicitly specify a target "x" on the command line, but >>> you don't know whether it's a File or a Dir? >>> Can you come up with a short user scenario for this? What is it that >>> you're trying to accomplish? >>> >> >> The short user scenario - a person want to build wesnoth and executes >> `scons`. The output says that possible targets are "wesnoth" and >> "wesnothd". Because I don't have dependencies for "wesnoth", I specify >> "wesnothd" which ends up as str in BUILD_TARGETS and I can not traverse it. >> > > Normally you just say e = Entry(str), which converts the string to an > Entry, which is a Node whose type is unknown. At various points Entry > nodes are converted to their correct type once it can be deduced >
This sound very magic. For now I used the `arg2nodes_lookups` solution. Here is the result: https://gist.github.com/techtonik/8f53e9866beed570ead4#file-treelog-py The .json file can be visualized here: http://techtonik.bitbucket.org/graphs/index.html -- anatoly t.
_______________________________________________ Scons-dev mailing list Scons-dev@scons.org https://pairlist2.pair.net/mailman/listinfo/scons-dev