[Scons-users] Reading SCons.Variables from file

Evan Driscoll driscoll at cs.wisc.edu
Tue Nov 13 19:20:16 EST 2012


On 11/13/2012 05:29 PM, Pawel Tomulik wrote:

> Hi,

>

> The API documentation for SCons.Variables.Variables.__init__()

>

> http://www.scons.org/doc/latest/HTML/scons-api/SCons.Variables.Variables-class.html#__init__

>

>

> states what follows:

>

> files - [optional] List of option configuration files to load

> (backward compatibility) If a single string is passed it is

> automatically placed in a file list

>

> Does the "backward compatibility" mean that there is another

> better way to read variables from file, another/better way to

> specify the filename(s), the function accepts a list only for

> backward compatibility reasons or what can it mean at all?


My reading:

Variables.__init__() can take multiple files:

Variables(files=["myfile1", "myfile2"])

or a single file:

Variables(file=["myfile"])

and that the latter is also accepted as

Variables(file="myfile")

for backwards compatibility reasons (maybe at one point you could only
specify a single file?).


I don't know of another way to read variables from a file (well, you
could code it up manually...), just that it may be recommended to use
the Variables(file=["myfile"]) form even for singletons. I am not sure
how strong of a recommendation this is, however.

Evan




>

> Any ideas?

>

> BTW. Are there other "SCons-native" ways to load/save selected

> construction (env) variables from/to file to make them persistent

> between runs?

>

> With best regards,

>



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 554 bytes
Desc: OpenPGP digital signature
Url : <http://four.pairlist.net/pipermail/scons-users/attachments/20121113/2ff0eaca/attachment.pgp>


More information about the Scons-users mailing list