Package SCons :: Module Builder :: Class BuilderBase
[hide private]
[frames] | no frames]

Class BuilderBase

source code

object --+
         |
        BuilderBase

Base class for Builders, objects that create output
nodes (files) from input nodes (files).



Instance Methods [hide private]
 
__init__(self, action=False, prefix='', suffix='', src_suffix='', target_factory=False, source_factory=False, target_scanner=False, source_scanner=False, emitter=False, multi=0, env=False, single_source=0, name=False, chdir=<class 'SCons.Builder._Null'>, is_explicit=1, src_builder=False, ensure_suffix=False, **overrides)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__nonzero__(self) source code
 
get_name(self, env)
Attempts to get the name of the Builder.
source code
 
__cmp__(self, other) source code
 
splitext(self, path, env=False) source code
 
_adjustixes(self, files, pre, suf, ensure_suffix=False) source code
 
_create_nodes(self, env, target=False, source=False)
Create and return lists of target and source nodes.
source code
 
_execute(self, env, target, source, overwarn={}, executor_kw={}) source code
 
__call__(self, env, target=False, source=False, chdir=<class 'SCons.Builder._Null'>, **kw) source code
 
adjust_suffix(self, suff) source code
 
get_prefix(self, env, sources=[]) source code
 
set_suffix(self, suffix) source code
 
get_suffix(self, env, sources=[]) source code
 
set_src_suffix(self, src_suffix) source code
 
get_src_suffix(self, env)
Get the first src_suffix in the list of src_suffixes.
source code
 
add_emitter(self, suffix, emitter)
Add a suffix-emitter mapping to this Builder.
source code
 
add_src_builder(self, builder)
Add a new Builder to the list of src_builders.
source code
 
_get_sdict(self, env)
Returns a dictionary mapping all of the source suffixes of all src_builders of this Builder to the underlying Builder that should be called first.
source code
 
src_builder_sources(self, env, source, overwarn={}) source code
 
_get_src_builders_key(self, env) source code
 
get_src_builders(self, env)
Returns the list of source Builders for this Builder.
source code
 
_subst_src_suffixes_key(self, env) source code
 
subst_src_suffixes(self, env)
The suffix list may contain construction variable expansions, so we have to evaluate the individual strings.
source code
 
src_suffixes(self, env)
Returns the list of source suffixes for all src_builders of this Builder.
source code

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

Class Variables [hide private]
  __metaclass__ = SCons.Memoize.Memoized_Metaclass
  memoizer_counters = [<SCons.Memoize.CountDict object at 0x871d...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, action=False, prefix='', suffix='', src_suffix='', target_factory=False, source_factory=False, target_scanner=False, source_scanner=False, emitter=False, multi=0, env=False, single_source=0, name=False, chdir=<class 'SCons.Builder._Null'>, is_explicit=1, src_builder=False, ensure_suffix=False, **overrides)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

get_name(self, env)

source code 
Attempts to get the name of the Builder.

Look at the BUILDERS variable of env, expecting it to be a
dictionary containing this Builder, and return the key of the
dictionary.  If there's no key, then return a directly-configured
name (if there is one) or the name of the class (by default).

add_emitter(self, suffix, emitter)

source code 
Add a suffix-emitter mapping to this Builder.

This assumes that emitter has been initialized with an
appropriate dictionary type, and will throw a TypeError if
not, so the caller is responsible for knowing that this is an
appropriate method to call for the Builder in question.

add_src_builder(self, builder)

source code 

Add a new Builder to the list of src_builders.

This requires wiping out cached values so that the computed
lists of source suffixes get re-calculated.

_get_sdict(self, env)

source code 

Returns a dictionary mapping all of the source suffixes of all
src_builders of this Builder to the underlying Builder that
should be called first.

This dictionary is used for each target specified, so we save a
lot of extra computation by memoizing it for each construction
environment.

Note that this is re-computed each time, not cached, because there
might be changes to one of our source Builders (or one of their
source Builders, and so on, and so on...) that we can't "see."

The underlying methods we call cache their computed values,
though, so we hope repeatedly aggregating them into a dictionary
like this won't be too big a hit.  We may need to look for a
better way to do this if performance data show this has turned
into a significant bottleneck.

get_src_builders(self, env)

source code 

Returns the list of source Builders for this Builder.

This exists mainly to look up Builders referenced as
strings in the 'BUILDER' variable of the construction
environment and cache the result.

subst_src_suffixes(self, env)

source code 

The suffix list may contain construction variable expansions,
so we have to evaluate the individual strings.  To avoid doing
this over and over, we memoize the results for each construction
environment.

src_suffixes(self, env)

source code 

Returns the list of source suffixes for all src_builders of this
Builder.

This is essentially a recursive descent of the src_builder "tree."
(This value isn't cached because there may be changes in a
src_builder many levels deep that we can't see.)


Class Variable Details [hide private]

memoizer_counters

Value:
[]