Package SCons :: Module Subst
[show private | hide private]
[frames | no frames]

Module SCons.Subst

SCons.Subst

SCons string substitution.

Classes
CmdStringHolder This is a special class used to hold strings generated by scons_subst() and scons_subst_list().
Literal A wrapper for a string.
NLWrapper A wrapper class that delays turning a list of sources or targets into a NodeList until it's needed.
SpecialAttrWrapper This is a wrapper for what we call a 'Node special attribute.' This is any of the attributes of a Node that we can reference from Environment variable substitution, such as $TARGET.abspath or $SOURCES[1].filebase.
Target_or_Source A class that implements $TARGET or $SOURCE expansions by in turn wrapping a NLWrapper.
Targets_or_Sources A class that implements $TARGETS or $SOURCES expansions by in turn wrapping a NLWrapper.

Function Summary
  escape_list(list, escape_func)
Escape a list of arguments by running the specified escape_func on every object in the list that has an escape() method.
  quote_spaces(arg)
Generic function for putting double quotes around any string that has white space in it.
  raise_exception(exception, target, s)
  scons_subst(strSubst, env, mode, target, source, gvars, lvars, conv)
Expand a string containing construction variable substitutions.
  scons_subst_list(strSubst, env, mode, target, source, gvars, lvars, conv)
Substitute construction variables in a string (or list or other object) and separate the arguments into a command list.
  scons_subst_once(strSubst, env, key)
Perform single (non-recursive) substitution of a single construction variable keyword.
  SetAllowableExceptions(*excepts)
  subst_dict(target, source)
Create a dictionary for substitution of special construction variables.

Function Details

escape_list(list, escape_func)

Escape a list of arguments by running the specified escape_func on every object in the list that has an escape() method.

quote_spaces(arg)

Generic function for putting double quotes around any string that has white space in it.

scons_subst(strSubst, env, mode=1, target=None, source=None, gvars={}, lvars={}, conv=None)

Expand a string containing construction variable substitutions.

This is the work-horse function for substitutions in file names and the like. The companion scons_subst_list() function (below) handles separating command lines into lists of arguments, so see that function if that's what you're looking for.

scons_subst_list(strSubst, env, mode=1, target=None, source=None, gvars={}, lvars={}, conv=None)

Substitute construction variables in a string (or list or other object) and separate the arguments into a command list.

The companion scons_subst() function (above) handles basic substitutions within strings, so see that function instead if that's what you're looking for.

scons_subst_once(strSubst, env, key)

Perform single (non-recursive) substitution of a single construction variable keyword.

This is used when setting a variable when copying or overriding values in an Environment. We want to capture (expand) the old value before we override it, so people can do things like:

env2 = env.Clone(CCFLAGS = '$CCFLAGS -g')

We do this with some straightforward, brute-force code here...

subst_dict(target, source)

Create a dictionary for substitution of special construction variables.

This translates the following special arguments:

target - the target (object or array of objects),
used to generate the TARGET and TARGETS construction variables
source - the source (object or array of objects),
used to generate the SOURCES and SOURCE construction variables

Generated by Epydoc 2.1 on Wed Dec 12 09:39:32 2007 http://epydoc.sf.net