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]
  DeciderNeedsNode
Indicate that the decider needs the node as well as the target and the dependency. Normally the node and the target are the same, but in the case of repository They may be different. Also the NodeInfo is retrieved from the node
  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 3a41ed6b288c...
  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: <__builtin__.function object>, 1: <__bui...
  _exists_map = {0: <__builtin__.function object>, 1: <__builtin...
  _rexists_map = {0: <__builtin__.function object>, 1: <__builti...
  _get_contents_map = {0: <__builtin__.function object>, 1: <__b...
  _target_from_source_map = {0: <__builtin__.function object>, 1...
  _decider_map = {0: <__builtin__.function object>, 1: <__builti...
  do_store_info = True
  store_info_map = {0: <__builtin__.function object>, 1: <__buil...
  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 3a41ed6b288cee8d085373ad7fa02894e19\
03864 2019-01-23 17:30:35 bdeegan'

StateString

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

_is_derived_map

Value:
{0: <__builtin__.function object>, 1: <__builtin__.function object>}

_exists_map

Value:
{0: <__builtin__.function object>,
 1: <__builtin__.function object>,
 2: <__builtin__.function object>,
 3: <__builtin__.function object>,
 4: <__builtin__.function object>}

_rexists_map

Value:
{0: <__builtin__.function object>,
 1: <__builtin__.function object>,
 2: <__builtin__.function object>}

_get_contents_map

Value:
{0: <__builtin__.function object>,
 1: <__builtin__.function object>,
 2: <__builtin__.function object>,
 3: <__builtin__.function object>}

_target_from_source_map

Value:
{0: <__builtin__.function object>, 1: <__builtin__.function object>}

_decider_map

Value:
{0: <__builtin__.function object>,
 1: <__builtin__.function object>,
 2: <__builtin__.function object>,
 3: <__builtin__.function object>,
 4: <__builtin__.function object>,
 5: <__builtin__.function object>,
 6: <__builtin__.function object>}

store_info_map

Value:
{0: <__builtin__.function object>, 1: <__builtin__.function object>}