Package SCons :: Module Environment :: Class Base
[hide private]
[frames] | no frames]

Class Base

source code

             object --+    
                      |    
SubstitutionEnvironment --+
                          |
                         Base
Known Subclasses:

Base class for "real" construction Environments. These are the primary objects used to communicate dependency and construction information to the build engine.

Keyword arguments supplied when the construction Environment is created are construction variables used to initialize the Environment.

Instance Methods [hide private]
 
Action(self, *args, **kw) source code
 
AddPostAction(self, files, action) source code
 
AddPreAction(self, files, action) source code
 
Alias(self, target, source=[], action=None, **kw) source code
 
AlwaysBuild(self, *targets) source code
 
Append(self, **kw)
Append values to existing construction variables in an Environment.
source code
 
AppendENVPath(self, name, newpath, envname='ENV', sep=':', delete_existing=1)
Append path elements to the path 'name' in the 'ENV' dictionary for this environment. Will only add any particular path once, and will normpath and normcase all paths to help assure this. This can also handle the case where the env variable is a list instead of a string.
source code
 
AppendUnique(self, delete_existing=0, **kw)
Append values to existing construction variables in an Environment, if they're not already there. If delete_existing is 1, removes existing values first, so values move to end.
source code
 
BuildDir(self, *args, **kw) source code
 
Builder(self, **kw) source code
 
CacheDir(self, path) source code
 
Clean(self, targets, files) source code
 
Clone(self, tools=[], toolpath=None, parse_flags=None, **kw)
Return a copy of a construction Environment. The copy is like a Python "deep copy"--that is, independent copies are made recursively of each objects--except that a reference is copied when an object is not deep-copyable (like a function). There are no references to any mutable objects in the original Environment.
source code
 
Command(self, target, source, action, **kw)
Builds the supplied target files from the supplied source files using the supplied action. Action may be any type that the Builder constructor will accept for an action.
source code
 
Configure(self, *args, **kw) source code
 
Copy(self, *args, **kw) source code
 
Decider(self, function) source code
 
Depends(self, target, dependency)
Explicity specify that 'target's depend on 'dependency'.
source code
 
Detect(self, progs)
Return the first available program in progs.
source code
 
Dictionary(self, *args) source code
 
Dir(self, name, *args, **kw) source code
 
Dump(self, key=None)
Using the standard Python pretty printer, dump the contents of the scons build environment to stdout.
source code
 
Entry(self, name, *args, **kw) source code
 
Environment(self, **kw) source code
 
Execute(self, action, *args, **kw)
Directly execute an action through an Environment
source code
 
File(self, name, *args, **kw) source code
 
FindFile(self, file, dirs) source code
 
FindInstalledFiles(self)
returns the list of all targets of the Install and InstallAs Builder.
source code
 
FindIxes(self, paths, prefix, suffix)
Search a list of paths for something that matches the prefix and suffix.
source code
 
FindSourceFiles(self, node='.')
returns a list of all source files.
source code
 
Flatten(self, sequence) source code
 
GetBuildPath(self, files) source code
 
Glob(self, pattern, ondisk=True, source=False, strings=False) source code
 
Ignore(self, target, dependency)
Ignore a dependency.
source code
 
Literal(self, string) source code
 
Local(self, *targets) source code
 
NoCache(self, *targets)
Tags a target so that it will not be cached
source code
 
NoClean(self, *targets)
Tags a target so that it will not be cleaned by -c
source code
 
ParseConfig(self, command, function=None, unique=1)
Use the specified function to parse the output of the command in order to modify the current environment. The 'command' can be a string or a list of strings representing a command and its arguments. 'Function' is an optional argument that takes the environment, the output of the command, and the unique flag. If no function is specified, MergeFlags, which treats the output as the result of a typical 'X-config' command (i.e. gtk-config), will merge the output into the appropriate variables.
source code
 
ParseDepends(self, filename, must_exist=None, only_one=0)
Parse a mkdep-style file for explicit dependencies. This is completely abusable, and should be unnecessary in the "normal" case of proper SCons configuration, but it may help make the transition from a Make hierarchy easier for some people to swallow. It can also be genuinely useful when using a tool that can write a .d file, but for which writing a scanner would be too complicated.
source code
 
Platform(self, platform) source code
 
Precious(self, *targets) source code
 
Prepend(self, **kw)
Prepend values to existing construction variables in an Environment.
source code
 
PrependENVPath(self, name, newpath, envname='ENV', sep=':', delete_existing=1)
Prepend path elements to the path 'name' in the 'ENV' dictionary for this environment. Will only add any particular path once, and will normpath and normcase all paths to help assure this. This can also handle the case where the env variable is a list instead of a string.
source code
 
PrependUnique(self, delete_existing=0, **kw)
Prepend values to existing construction variables in an Environment, if they're not already there. If delete_existing is 1, removes existing values first, so values move to front.
source code
 
Pseudo(self, *targets) source code
 
Replace(self, **kw)
Replace existing construction variables in an Environment with new construction variables and/or values.
source code
 
ReplaceIxes(self, path, old_prefix, old_suffix, new_prefix, new_suffix)
Replace old_prefix with new_prefix and old_suffix with new_suffix.
source code
 
Repository(self, *dirs, **kw) source code
 
Requires(self, target, prerequisite)
Specify that 'prerequisite' must be built before 'target', (but 'target' does not actually depend on 'prerequisite' and need not be rebuilt if it changes).
source code
 
SConsignFile(self, name='.sconsign', dbm_module=None) source code
 
Scanner(self, *args, **kw) source code
 
SetDefault(self, **kw) source code
 
SideEffect(self, side_effect, target)
Tell scons that side_effects are built as side effects of building targets.
source code
 
SourceCode(self, entry, builder)
Arrange for a source code builder for (part of) a tree.
source code
 
SourceSignatures(self, type) source code
 
Split(self, arg)
This function converts a string or list into a list of strings or Nodes.
source code
 
TargetSignatures(self, type) source code
 
Tool(self, tool, toolpath=None, **kw) source code
 
Value(self, value, built_value=None) source code
 
VariantDir(self, variant_dir, src_dir, duplicate=1) source code
 
WhereIs(self, prog, path=None, pathext=None, reject=[])
Find prog in the path.
source code
 
__init__(self, platform=None, tools=None, toolpath=None, variables=None, parse_flags=None, **kw)
Initialization of a basic SCons construction environment, including setting up special construction variables like BUILDER, PLATFORM, etc., and searching for and applying available Tools.
source code
 
_canonicalize(self, path) source code
 
_changed_build(self, dependency, target, prev_ni) source code
 
_changed_content(self, dependency, target, prev_ni) source code
 
_changed_source(self, dependency, target, prev_ni) source code
 
_changed_timestamp_match(self, dependency, target, prev_ni) source code
 
_changed_timestamp_newer(self, dependency, target, prev_ni) source code
 
_changed_timestamp_then_content(self, dependency, target, prev_ni) source code
 
_copy2_from_cache(self, src, dst) source code
 
_copy_from_cache(self, src, dst) source code
 
_find_toolpath_dir(self, tp) source code
 
_gsm(self) source code
 
_update(self, dict)
Update an environment's values directly, bypassing the normal checks that occur when users try to set items.
source code
 
get_CacheDir(self) source code
 
get_builder(self, name)
Fetch the builder with the specified name from the environment.
source code
 
get_factory(self, factory, default='File')
Return a factory function for creating Nodes for this construction environment.
source code
 
get_scanner(self, skey)
Find the appropriate scanner given a key (usually a file suffix).
source code
 
get_src_sig_type(self) source code
 
get_tgt_sig_type(self) source code
 
scanner_map_delete(self, kw=None)
Delete the cached scanner map (if we need to).
source code

Inherited from SubstitutionEnvironment: AddMethod, MergeFlags, Override, ParseFlags, RemoveMethod, __cmp__, __contains__, __delitem__, __getitem__, __setitem__, arg2nodes, backtick, get, gvars, has_key, items, lvars, subst, subst_kw, subst_list, subst_path, subst_target_source

Inherited from SubstitutionEnvironment (private): _init_special

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  memoizer_counters = []

Inherited from SubstitutionEnvironment: __metaclass__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

AppendENVPath(self, name, newpath, envname='ENV', sep=':', delete_existing=1)

source code 

Append path elements to the path 'name' in the 'ENV' dictionary for this environment. Will only add any particular path once, and will normpath and normcase all paths to help assure this. This can also handle the case where the env variable is a list instead of a string.

If delete_existing is 0, a newpath which is already in the path will not be moved to the end (it will be left where it is).

Dump(self, key=None)

source code 

Using the standard Python pretty printer, dump the contents of the scons build environment to stdout.

If the key passed in is anything other than None, then that will be used as an index into the build environment dictionary and whatever is found there will be fed into the pretty printer. Note that this key is case sensitive.

FindIxes(self, paths, prefix, suffix)

source code 

Search a list of paths for something that matches the prefix and suffix.

paths - the list of paths or nodes. prefix - construction variable for the prefix. suffix - construction variable for the suffix.

PrependENVPath(self, name, newpath, envname='ENV', sep=':', delete_existing=1)

source code 

Prepend path elements to the path 'name' in the 'ENV' dictionary for this environment. Will only add any particular path once, and will normpath and normcase all paths to help assure this. This can also handle the case where the env variable is a list instead of a string.

If delete_existing is 0, a newpath which is already in the path will not be moved to the front (it will be left where it is).

ReplaceIxes(self, path, old_prefix, old_suffix, new_prefix, new_suffix)

source code 

Replace old_prefix with new_prefix and old_suffix with new_suffix.

env - Environment used to interpolate variables. path - the path that will be modified. old_prefix - construction variable for the old prefix. old_suffix - construction variable for the old suffix. new_prefix - construction variable for the new prefix. new_suffix - construction variable for the new suffix.

Split(self, arg)

source code 
This function converts a string or list into a list of strings
or Nodes.  This makes things easier for users by allowing files to
be specified as a white-space separated list to be split.
The input rules are:
    - A single string containing names separated by spaces. These will be
      split apart at the spaces.
    - A single Node instance
    - A list containing either strings or Node instances. Any strings
      in the list are not split at spaces.
In all cases, the function returns a list of Nodes and strings.

__init__(self, platform=None, tools=None, toolpath=None, variables=None, parse_flags=None, **kw)
(Constructor)

source code 

Initialization of a basic SCons construction environment, including setting up special construction variables like BUILDER, PLATFORM, etc., and searching for and applying available Tools.

Note that we do not call the underlying base class (SubsitutionEnvironment) initialization, because we need to initialize things in a very specific order that doesn't work with the much simpler base class initialization.

Overrides: object.__init__