Package SCons :: Package Node
[hide private]
[frames] | no frames]

Package Node

source code

SCons.Node

The Node package for the SCons software construction utility.

This is, in many ways, the heart of SCons.

A Node is where we encapsulate all of the dependency information about any thing that SCons can build, or about any thing which SCons can use to build some other thing. The canonical "thing," of course, is a file, but a Node can also represent something remote (like a web page) or something completely abstract (like an Alias).

Each specific type of "thing" is specifically represented by a subclass of the Node base class: Node.FS.File for files, Node.Alias for aliases, etc. Dependency information is kept here in the base class, and information specific to files/aliases/etc. is in the subclass. The goal, if we've done this correctly, is that any type of "thing" should be able to depend on any other type of "thing."

Submodules [hide private]

Classes [hide private]
  NodeInfoBase
The generic base class for signature information for a Node.
  BuildInfoBase
The generic base class for build information for a Node.
  Node
The base Node class, for entities that we know how to build, or use to build other Nodes.
  NodeList
  Walker
An iterator for walking a Node tree.
Functions [hide private]
 
classname(obj) source code
 
Annotate(node) source code
 
is_derived_none(node) source code
 
is_derived_node(node)
Returns true if this node is derived (i.e. built).
source code
 
exists_none(node) source code
 
exists_always(node) source code
 
exists_base(node) source code
 
exists_entry(node)
Return if the Entry exists. Check the file system to see what we should turn into first. Assume a file if there's no directory.
source code
 
exists_file(node) source code
 
rexists_none(node) source code
 
rexists_node(node) source code
 
rexists_base(node) source code
 
get_contents_none(node) source code
 
get_contents_entry(node)
Fetch the contents of the entry. Returns the exact binary contents of the file.
source code
 
get_contents_dir(node)
Return content signatures and names of all our children separated by new-lines. Ensure that the nodes are sorted.
source code
 
get_contents_file(node) source code
 
target_from_source_none(node, prefix, suffix, splitext) source code
 
target_from_source_base(node, prefix, suffix, splitext) source code
 
changed_since_last_build_node(node, target, prev_ni)
Must be overridden in a specific subclass to return True if this Node (a dependency) has changed since the last time it was used to build the specified target. prev_ni is this Node's state (for example, its file timestamp, length, maybe content signature) as of the last time the target was built.
source code
 
changed_since_last_build_alias(node, target, prev_ni) source code
 
changed_since_last_build_entry(node, target, prev_ni) source code
 
changed_since_last_build_state_changed(node, target, prev_ni) source code
 
decide_source(node, target, prev_ni) source code
 
decide_target(node, target, prev_ni) source code
 
changed_since_last_build_python(node, target, prev_ni) source code
 
store_info_pass(node) source code
 
store_info_file(node) source code
 
get_children(node, parent) source code
 
ignore_cycle(node, stack) source code
 
do_nothing(node, parent) source code
Variables [hide private]
  __revision__ = 'src/engine/SCons/Node/__init__.py rel_2.4.0:33...
  print_duplicate = 0
  no_state = 0
  pending = 1
  executing = 2
  up_to_date = 3
  executed = 4
  failed = 5
  StateString = {0: 'no_state', 1: 'pending', 2: 'executing', 3:...
  implicit_cache = 0
  implicit_deps_unchanged = 0
  implicit_deps_changed = 0
  interactive = False
  _is_derived_map = {0: is_derived_none, 1: is_derived_node}
  _exists_map = {0: exists_none, 1: exists_always, 2: exists_bas...
  _rexists_map = {0: rexists_none, 1: rexists_node, 2: rexists_b...
  _get_contents_map = {0: get_contents_none, 1: get_contents_ent...
  _target_from_source_map = {0: target_from_source_none, 1: targ...
  _decider_map = {0: changed_since_last_build_node, 1: changed_s...
  do_store_info = True
  store_info_map = {0: store_info_pass, 1: store_info_file}
  arg2nodes_lookups = [<bound method AliasNameSpace.lookup of {}>]
  __package__ = 'SCons.Node'
Function Details [hide private]

changed_since_last_build_node(node, target, prev_ni)

source code 

Must be overridden in a specific subclass to return True if this Node (a dependency) has changed since the last time it was used to build the specified target. prev_ni is this Node's state (for example, its file timestamp, length, maybe content signature) as of the last time the target was built.

Note that this method is called through the dependency, not the target, because a dependency Node must be able to use its own logic to decide if it changed. For example, File Nodes need to obey if we're configured to use timestamps, but Python Value Nodes never use timestamps and always use the content. If this method were called through the target, then each Node's implementation of this method would have to have more complicated logic to handle all the different Node types on which it might depend.


Variables Details [hide private]

__revision__

Value:
'src/engine/SCons/Node/__init__.py rel_2.4.0:3365:9259ea1c13d7 2015/09\
/21 14:03:43 bdbaddog'

StateString

Value:
{0: 'no_state',
 1: 'pending',
 2: 'executing',
 3: 'up_to_date',
 4: 'executed',
 5: 'failed'}

_exists_map

Value:
{0: exists_none, 1: exists_always, 2: exists_base, 3: exists_entry, 4:\
 exists_file}

_rexists_map

Value:
{0: rexists_none, 1: rexists_node, 2: rexists_base}

_get_contents_map

Value:
{0: get_contents_none, 1: get_contents_entry, 2: get_contents_dir, 3: \
get_contents_file}

_target_from_source_map

Value:
{0: target_from_source_none, 1: target_from_source_base}

_decider_map

Value:
{0: changed_since_last_build_node, 1: changed_since_last_build_alias, \
2: changed_since_last_build_entry, 3: changed_since_last_build_state_c\
hanged, 4: decide_source, 5: decide_target, 6: changed_since_last_buil\
d_python}