SCons :: Action :: LazyAction :: Class LazyAction
[hide private]
[frames] | no frames]

Class LazyAction

source code

        object --+        
                 |        
        ActionBase --+    
                     |    
CommandGeneratorAction --+
                         |
    object --+           |
             |           |
    ActionBase --+       |
                 |       |
     _ActionAction --+   |
                     |   |
         CommandAction --+
                         |
                        LazyAction

A LazyAction is a kind of hybrid generator and command action for strings of the form "$VAR". These strings normally expand to other strings (think "$CCCOM" to "$CC -c -o $TARGET $SOURCE"), but we also want to be able to replace them with functions in the construction environment. Consequently, we want lazy evaluation and creation of an Action in the case of the function, but that's overkill in the more normal case of expansion to other strings.

So we do this with a subclass that's both a generator and a command action. The overridden methods all do a quick check of the construction variable, and if it's a string we just call the corresponding CommandAction method to do the heavy lifting. If not, then we call the same-named CommandGeneratorAction method. The CommandGeneratorAction methods work by using the overridden _generate() method, that is, our own way of handling "generation" of an action based on what's in the construction variable.

Instance Methods [hide private]
 
__init__(self, var, kw)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
get_parent_class(self, env) source code
 
_generate_cache(self, env) source code
 
_generate(self, target, source, env, for_signature, executor=None) source code
 
__call__(self, target, source, env, *args, **kw) source code
 
get_presig(self, target, source, env)
Return the signature contents of this action's command line.
source code
 
get_varlist(self, target, source, env, executor=None) source code

Inherited from CommandGeneratorAction: __str__, batch_key, genstring, get_implicit_deps, get_targets

Inherited from CommandAction: execute, process, strfunction

Inherited from _ActionAction: print_cmd_line

Inherited from ActionBase: __add__, __eq__, __radd__, get_contents, no_batch_key, presub_lines

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, var, kw)
(Constructor)

source code 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__
(inherited documentation)

_generate(self, target, source, env, for_signature, executor=None)

source code 
Overrides: CommandGeneratorAction._generate

__call__(self, target, source, env, *args, **kw)
(Call operator)

source code 
Overrides: _ActionAction.__call__

get_presig(self, target, source, env)

source code 

Return the signature contents of this action's command line.

This strips $(-$) and everything in between the string, since those parts don't affect signatures.

Overrides: CommandAction.get_presig
(inherited documentation)

get_varlist(self, target, source, env, executor=None)

source code 
Overrides: ActionBase.get_varlist