diff options
author | Steven Knight <knight@baldmt.com> | 2004-11-15 12:43:04 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2004-11-15 12:43:04 (GMT) |
commit | 949becdd3c7437c6f6af345e25c80c24d696d487 (patch) | |
tree | f78ea2576c829038d84949add151f4a6bee1274c /src/engine/SCons/Action.py | |
parent | 2822ea95237efa0c8a069e764c3560a3ea221cc0 (diff) | |
download | SCons-949becdd3c7437c6f6af345e25c80c24d696d487.zip SCons-949becdd3c7437c6f6af345e25c80c24d696d487.tar.gz SCons-949becdd3c7437c6f6af345e25c80c24d696d487.tar.bz2 |
Easier customization of printable strings for , and .
Diffstat (limited to 'src/engine/SCons/Action.py')
-rw-r--r-- | src/engine/SCons/Action.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/engine/SCons/Action.py b/src/engine/SCons/Action.py index a8e6c5b..545bd61 100644 --- a/src/engine/SCons/Action.py +++ b/src/engine/SCons/Action.py @@ -323,7 +323,7 @@ def _string_from_cmd_list(cmd_list): class CommandAction(_ActionAction): """Class for command-execution actions.""" - def __init__(self, cmd, *args, **kw): + def __init__(self, cmd, cmdstr=None, *args, **kw): # Cmd can actually be a list or a single item; if it's a # single item it should be the command string to execute; if a # list then it should be the words of the command string to @@ -340,6 +340,7 @@ class CommandAction(_ActionAction): raise TypeError, "CommandAction should be given only " \ "a single command" self.cmd_list = cmd + self.cmdstr = cmdstr def __str__(self): if SCons.Util.is_List(self.cmd_list): @@ -347,6 +348,10 @@ class CommandAction(_ActionAction): return str(self.cmd_list) def strfunction(self, target, source, env): + if not self.cmdstr is None: + c = env.subst(self.cmdstr, 0, target, source) + if c: + return c cmd_list = env.subst_list(self.cmd_list, 0, target, source) return _string_from_cmd_list(cmd_list[0]) |