summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Util.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2003-09-25 05:18:23 (GMT)
committerSteven Knight <knight@baldmt.com>2003-09-25 05:18:23 (GMT)
commit41a3eeec87272670f593f46ab8558d0ab99046f5 (patch)
tree99bf886e89cd998dd6a32bdeb6894f15243122ce /src/engine/SCons/Util.py
parentfd20ba3535a82bc7a6749d0020b344f4957ebc5d (diff)
downloadSCons-41a3eeec87272670f593f46ab8558d0ab99046f5.zip
SCons-41a3eeec87272670f593f46ab8558d0ab99046f5.tar.gz
SCons-41a3eeec87272670f593f46ab8558d0ab99046f5.tar.bz2
Add more environment methods for global functions: Action(), Builder(), Environment(), Literal(), Platform(), Split(), Tool(). Deprecate ParseConfig() in favor of an environment method.
Diffstat (limited to 'src/engine/SCons/Util.py')
-rw-r--r--src/engine/SCons/Util.py65
1 files changed, 0 insertions, 65 deletions
diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py
index 38b25af..c0bc6ac 100644
--- a/src/engine/SCons/Util.py
+++ b/src/engine/SCons/Util.py
@@ -621,24 +621,6 @@ def is_Dict(e):
def is_List(e):
return type(e) is types.ListType or isinstance(e, UserList.UserList)
-def Split(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 is_List(arg):
- return arg
- elif is_String(arg):
- return string.split(arg)
- else:
- return [arg]
-
def mapPaths(paths, dir, env=None):
"""Takes a single node or string, or a list of nodes and/or
strings. We leave the nodes untouched, but we put the strings
@@ -918,53 +900,6 @@ def AppendPath(oldpath, newpath, sep = os.pathsep):
return string.join(paths, sep)
-def ParseConfig(env, command, function=None):
- """Use the specified function to parse the output of the command in order
- to modify the specified environment. The 'command' can be a string or a
- list of strings representing a command and it's arguments. 'Function' is
- an optional argument that takes the environment and the output of the
- command. If no function is specified, the output will be treated as the
- output of a typical 'X-config' command (i.e. gtk-config) and used to set
- the CPPPATH, LIBPATH, LIBS, and CCFLAGS variables.
- """
- # the default parse function
- def parse_conf(env, output):
- env_dict = env.Dictionary()
- static_libs = []
-
- # setup all the dictionary options
- if not env_dict.has_key('CPPPATH'):
- env_dict['CPPPATH'] = []
- if not env_dict.has_key('LIBPATH'):
- env_dict['LIBPATH'] = []
- if not env_dict.has_key('LIBS'):
- env_dict['LIBS'] = []
- if not env_dict.has_key('CCFLAGS') or env_dict['CCFLAGS'] == "":
- env_dict['CCFLAGS'] = []
-
- params = string.split(output)
- for arg in params:
- switch = arg[0:1]
- opt = arg[1:2]
- if switch == '-':
- if opt == 'L':
- env_dict['LIBPATH'].append(arg[2:])
- elif opt == 'l':
- env_dict['LIBS'].append(arg[2:])
- elif opt == 'I':
- env_dict['CPPPATH'].append(arg[2:])
- else:
- env_dict['CCFLAGS'].append(arg)
- else:
- static_libs.append(arg)
- return static_libs
-
- if function is None:
- function = parse_conf
- if type(command) is type([]):
- command = string.join(command)
- return function(env, os.popen(command).read())
-
def dir_index(directory):
files = []
for file in os.listdir(directory):