[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

using scons as a library

Tim Arnold

2/8/2008 1:50:00 PM

Hi, I've been reading up on the SCons build tool. It's intended to
work by the end-user calling 'scons' on a buildscript. However, I'd
like to use it from my own python project as an imported module, and
have my already-written classes use the Scons objects to take actions
without an external script.

The reason for this somewhat odd question is that I don't want SCons
to build the project--the project itself builds documentation (pdf/
html/xml) from LaTeX sources--my classes handle some complex
configuration issues, source parsing, actual rendering, etc. What I
would gain by using SCons is to let my code hand-off tasks to SCons
like making and cleaning directories, creating zip files, interacting
with CVS, etc.

Has anyone tried this before? It seems doable, but if someone has an
example that would help to shorten my learning curve.

thanks,
--Tim Arnold


1 Answer

Miki

2/9/2008 2:57:00 AM

0

Hello Tim,

> Hi, I've been reading up on the SCons build tool. It's intended to
> work by the end-user calling 'scons' on a buildscript. However, I'd
> like to use it from my own python project as an imported module, and
> have my already-written classes use the Scons objects to take actions
> without an external script.
>
> The reason for this somewhat odd question is that I don't want SCons
> to build the project--the project itself builds documentation (pdf/
> html/xml) from LaTeX sources--my classes handle some complex
> configuration issues, source parsing, actual rendering, etc. What I
> would gain by using SCons is to let my code hand-off tasks to SCons
> like making and cleaning directories, creating zip files, interacting
> with CVS, etc.
>
> Has anyone tried this before? It seems doable, but if someone has an
> example that would help to shorten my learning curve.
Just have a look at the "scons" script:
import SCons.Script
SCons.Script.main()

Looks simple enough.

HTH,
--
Miki <miki.tebeka@gmail.com>
http://pythonwise.bl...