diff options
author | Steven Knight <knight@baldmt.com> | 2002-12-28 07:17:31 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2002-12-28 07:17:31 (GMT) |
commit | ee46aa600c5aa266f0904c686e656ab545375820 (patch) | |
tree | 733a58e6a58301011d17feb2054dba6c9b981aa4 /src/engine/SCons/Action.py | |
parent | 474383d6f14d1594ad394c22afd837d1522175e9 (diff) | |
download | SCons-ee46aa600c5aa266f0904c686e656ab545375820.zip SCons-ee46aa600c5aa266f0904c686e656ab545375820.tar.gz SCons-ee46aa600c5aa266f0904c686e656ab545375820.tar.bz2 |
Change the Action object execute() methods to __call__() methods.
Diffstat (limited to 'src/engine/SCons/Action.py')
-rw-r--r-- | src/engine/SCons/Action.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/engine/SCons/Action.py b/src/engine/SCons/Action.py index d36c860..d8a08be 100644 --- a/src/engine/SCons/Action.py +++ b/src/engine/SCons/Action.py @@ -197,7 +197,7 @@ class CommandAction(ActionBase): def __init__(self, cmd): self.cmd_list = cmd - def execute(self, target, source, env): + def __call__(self, target, source, env): """Execute a command action. This will handle lists of commands as well as individual commands, @@ -286,11 +286,12 @@ class CommandGeneratorAction(ActionBase): raise SCons.Errors.UserError("Object returned from command generator: %s cannot be used to create an Action." % repr(ret)) return gen_cmd - def execute(self, target, source, env): + def __call__(self, target, source, env): if not SCons.Util.is_List(source): source = [source] rsources = map(rfile, source) - return self.__generate(target, source, env, 0).execute(target, rsources, env) + act = self.__generate(target, source, env, 0) + return act(target, rsources, env) def get_contents(self, target, source, env): """Return the signature contents of this action's command line. @@ -342,7 +343,7 @@ class FunctionAction(ActionBase): return "%s(%s, %s)" % (name, tstr, sstr) self.strfunction = strfunction - def execute(self, target, source, env): + def __call__(self, target, source, env): r = 0 if not SCons.Util.is_List(target): target = [target] @@ -381,9 +382,9 @@ class ListAction(ActionBase): def get_actions(self): return self.list - def execute(self, target, source, env): + def __call__(self, target, source, env): for l in self.list: - r = l.execute(target, source, env) + r = l(target, source, env) if r: return r return 0 |