diff options
author | Mats Wichmann <mats@linux.com> | 2019-12-20 19:52:01 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2019-12-20 19:52:01 (GMT) |
commit | f6d44c83fc88a3feffa88f747c5cceb875453059 (patch) | |
tree | 8d03a8bf994a493a39c33a178b6ab97680e79c93 /src | |
parent | 1b177138a204de2000cc490a96050e54e4626166 (diff) | |
download | SCons-f6d44c83fc88a3feffa88f747c5cceb875453059.zip SCons-f6d44c83fc88a3feffa88f747c5cceb875453059.tar.gz SCons-f6d44c83fc88a3feffa88f747c5cceb875453059.tar.bz2 |
[PR #3506] restore accidentally removed Split
Oops! somehow removed an extra function block.
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/SCons/Environment.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py index 36b7c3d..2c80424 100644 --- a/src/engine/SCons/Environment.py +++ b/src/engine/SCons/Environment.py @@ -2199,6 +2199,27 @@ class Base(SubstitutionEnvironment): target.side_effects.append(side_effect) return side_effects + def Split(self, arg): + """This function converts a string or list into a list of strings + or Nodes. This makes things easier for users by allowing files to + be specified as a white-space separated list to be split. + + The input rules are: + - A single string containing names separated by spaces. These will be + split apart at the spaces. + - A single Node instance + - A list containing either strings or Node instances. Any strings + in the list are not split at spaces. + + In all cases, the function returns a list of Nodes and strings.""" + + if SCons.Util.is_List(arg): + return list(map(self.subst, arg)) + elif SCons.Util.is_String(arg): + return self.subst(arg).split() + else: + return [self.subst(arg)] + def Value(self, value, built_value=None): """ """ |