SCons.Environment.OverrideEnvironment

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

# Class OverrideEnvironment

source code

    SubstitutionEnvironment --+
                              |
                           Base --+
                                  |
                                 OverrideEnvironment

A proxy that overrides variables in a wrapped construction environment by returning values from an overrides dictionary in preference to values from the underlying subject environment.

This is a lightweight (I hope) proxy that passes through most use of attributes to the underlying Environment.Base class, but has just enough additional methods defined to act like a real construction environment with overridden values. It can wrap either a Base construction environment, or another OverrideEnvironment, which can in turn nest arbitrary OverrideEnvironments...

Note that we do not call the underlying base class (SubsitutionEnvironment) initialization, because we get most of those from proxying the attributes of the subject construction environment. But because we subclass SubstitutionEnvironment, this class also has inherited arg2nodes() and subst*() methods; those methods can't be proxied because they need this object's methods to fetch the values from the overrides dictionary.

Instance Methods | [hide private]
__init__(self, subject, overrides=`{``}`) 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
__getattr__(self, name) | source code
__setattr__(self, name, value) | source code
__getitem__(self, key) | source code
__setitem__(self, key, value) | source code
__delitem__(self, key) | source code
get(self, key, default=False) Emulates the get() method of dictionaries. | source code
has_key(self, key) | source code
Dictionary(self) Emulates the items() method of dictionaries. | source code
items(self) Emulates the items() method of dictionaries. | 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
gvars(self) | source code
lvars(self) | source code
Replace(self, **kw) Replace existing construction variables in an Environment with new construction variables and/or values. | source code
Inherited from `Base`: `Action`, `AddPostAction`, `AddPreAction`, `Alias`, `AlwaysBuild`, `Append`, `AppendENVPath`, `AppendUnique`, `BuildDir`, `Builder`, `CacheDir`, `Clean`, `Clone`, `Command`, `Configure`, `Copy`, `Decider`, `Depends`, `Detect`, `Dir`, `Dump`, `Entry`, `Environment`, `Execute`, `File`, `FindFile`, `FindInstalledFiles`, `FindIxes`, `FindSourceFiles`, `Flatten`, `GetBuildPath`, `Glob`, `Ignore`, `Literal`, `Local`, `NoCache`, `NoClean`, `ParseConfig`, `ParseDepends`, `Platform`, `Precious`, `Prepend`, `PrependENVPath`, `PrependUnique`, `ReplaceIxes`, `Repository`, `Requires`, `SConsignFile`, `Scanner`, `SetDefault`, `SideEffect`, `SourceCode`, `SourceSignatures`, `Split`, `TargetSignatures`, `Tool`, `Value`, `VariantDir`, `WhereIs`, `get_CacheDir`, `get_builder`, `get_factory`, `get_scanner`, `get_src_sig_type`, `get_tgt_sig_type`, `scanner_map_delete` Inherited from `Base` (private): `_changed_build`, `_changed_content`, `_changed_source`, `_changed_timestamp_match`, `_changed_timestamp_newer`, `_changed_timestamp_then_content`, `_copy2_from_cache`, `_copy_from_cache`, `_find_toolpath_dir`, `_gsm` Inherited from `SubstitutionEnvironment`: `AddMethod`, `MergeFlags`, `Override`, `ParseFlags`, `RemoveMethod`, `__cmp__`, `arg2nodes`, `backtick`, `subst`, `subst_kw`, `subst_list`, `subst_path`, `subst_target_source` Inherited from `SubstitutionEnvironment` (private): `_init_special`

Class Variables | [hide private]
| __metaclass__ = `SCons.Memoize.Memoized_Metaclass`
Inherited from `Base`: `memoizer_counters`

Method Details | [hide private]

### __init__(self, subject, overrides=`{``}`) (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: Base.__init__ (inherited documentation)

### __getitem__(self, key) (Indexing operator) | source code
Overrides: SubstitutionEnvironment.__getitem__

### __setitem__(self, key, value) (Index assignment operator) | source code
Overrides: SubstitutionEnvironment.__setitem__

### __delitem__(self, key) (Index deletion operator) | source code
Overrides: SubstitutionEnvironment.__delitem__

### get(self, key, default=False) | source code
Emulates the get() method of dictionaries. Overrides: SubstitutionEnvironment.get

### has_key(self, key) | source code
Overrides: SubstitutionEnvironment.has_key

### Dictionary(self) | source code
Emulates the items() method of dictionaries. Overrides: Base.Dictionary

### items(self) | source code
Emulates the items() method of dictionaries. Overrides: SubstitutionEnvironment.items

### _update(self, dict) | source code
Update an environment's values directly, bypassing the normal checks that occur when users try to set items. Overrides: Base._update

### gvars(self) | source code
Overrides: SubstitutionEnvironment.gvars

### lvars(self) | source code
Overrides: SubstitutionEnvironment.lvars

### Replace(self, **kw) | source code
Replace existing construction variables in an Environment with new construction variables and/or values. Overrides: Base.Replace (inherited documentation)