From f6d44c83fc88a3feffa88f747c5cceb875453059 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Fri, 20 Dec 2019 12:52:01 -0700 Subject: [PR #3506] restore accidentally removed Split Oops! somehow removed an extra function block. Signed-off-by: Mats Wichmann --- src/engine/SCons/Environment.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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): """ """ -- cgit v0.12