diff options
author | Steven Knight <knight@baldmt.com> | 2004-10-24 03:57:51 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2004-10-24 03:57:51 (GMT) |
commit | 8c81e0623e2b1d792c84844761373a66dbe497ab (patch) | |
tree | 23128dee9f60768a6b230b965281b3b1fb91b700 /src/engine/SCons/Node/__init__.py | |
parent | dd5b36342a4bae64f8e49f12ed248b312968a9c1 (diff) | |
download | SCons-8c81e0623e2b1d792c84844761373a66dbe497ab.zip SCons-8c81e0623e2b1d792c84844761373a66dbe497ab.tar.gz SCons-8c81e0623e2b1d792c84844761373a66dbe497ab.tar.bz2 |
Refactor Action/Executor interaction. (Kevin Quick)
Diffstat (limited to 'src/engine/SCons/Node/__init__.py')
-rw-r--r-- | src/engine/SCons/Node/__init__.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py index 38cff92..31f8b58 100644 --- a/src/engine/SCons/Node/__init__.py +++ b/src/engine/SCons/Node/__init__.py @@ -167,7 +167,12 @@ class Node: if not create: raise import SCons.Executor - executor = SCons.Executor.Executor(self.builder.action, + act = self.builder.action + if self.pre_actions: + act = self.pre_actions + act + if self.post_actions: + act = act + self.post_actions + executor = SCons.Executor.Executor(act, self.builder.env, [self.builder.overrides], [self], @@ -175,6 +180,13 @@ class Node: self.executor = executor return executor + def reset_executor(self): + "Remove cached executor; forces recompute when needed." + try: + delattr(self, 'executor') + except AttributeError: + pass + def retrieve_from_cache(self): """Try to retrieve the node's content from a cache @@ -565,7 +577,7 @@ class Node: if self.has_builder(): executor = self.get_executor() - binfo.bact = executor.strfunction() + binfo.bact = str(executor) binfo.bactsig = calc.module.signature(executor) sigs.append(binfo.bactsig) @@ -795,11 +807,15 @@ class Node: """Adds an Action performed on this Node only before building it.""" self.pre_actions.append(act) + # executor must be recomputed to include new pre-actions + self.reset_executor() def add_post_action(self, act): """Adds and Action performed on this Node only after building it.""" self.post_actions.append(act) + # executor must be recomputed to include new pre-actions + self.reset_executor() def render_include_tree(self): """ |