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

Class BuilderBase


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


Method Summary
  __init__(self, action, prefix, suffix, src_suffix, target_factory, source_factory, target_scanner, source_scanner, emitter, multi, env, single_source, name, chdir, is_explicit, src_builder, ensure_suffix, **overrides)
  __call__(self, env, target, source, chdir, **kw)
  __cmp__(self, other)
  __nonzero__(self)
  add_emitter(self, suffix, emitter)
Add a suffix-emitter mapping to this Builder.
  add_src_builder(self, builder)
Add a new Builder to the list of src_builders.
  adjust_suffix(self, suff)
  get_multi_executor(self, env, tlist, slist, executor_kw)
  get_name(self, env)
Attempts to get the name of the Builder.
  get_prefix(self, env, sources)
  get_single_executor(self, env, tlist, slist, executor_kw)
  get_src_builders(self, env)
Returns the list of source Builders for this Builder.
  get_src_suffix(self, env)
Get the first src_suffix in the list of src_suffixes.
  get_suffix(self, env, sources)
  set_src_suffix(self, src_suffix)
  set_suffix(self, suffix)
  splitext(self, path, env)
  src_builder_sources(self, env, source, overwarn)
  src_suffixes(self, env)
Returns the list of source suffixes for all src_builders of this Builder.
  subst_src_suffixes(self, env)
The suffix list may contain construction variable expansions, so we have to evaluate the individual strings.
  _adjustixes(self, files, pre, suf, ensure_suffix)
  _create_nodes(self, env, target, source)
Create and return lists of target and source nodes.
  _execute(self, env, target, source, overwarn, executor_kw)
  _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.
  _get_src_builders_key(self, env)
  _subst_src_suffixes_key(self, env)

Class Variable Summary
list memoizer_counters = [<SCons.Memoize.CountDict instance a...

Method Details

add_emitter(self, suffix, emitter)

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)

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_name(self, env)

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).

get_src_builders(self, env)

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.

get_src_suffix(self, env)

Get the first src_suffix in the list of src_suffixes.

src_suffixes(self, env)

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.)

subst_src_suffixes(self, env)

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.

_create_nodes(self, env, target=None, source=None)

Create and return lists of target and source nodes.

_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.

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.


Class Variable Details

memoizer_counters

Type:
list
Value:
[<SCons.Memoize.CountDict instance at 0xd3aea8>,
 <SCons.Memoize.CountDict instance at 0xa3a6c8>]                       

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