diff options
Diffstat (limited to 'test/Scanner/generated.py')
-rw-r--r-- | test/Scanner/generated.py | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/test/Scanner/generated.py b/test/Scanner/generated.py index 5a69510..8c90df4 100644 --- a/test/Scanner/generated.py +++ b/test/Scanner/generated.py @@ -84,7 +84,6 @@ Mylib.Subdirs(env, "src") test.write('Mylib.py', """\ import os -import string import re def Subdirs(env, dirlist): @@ -92,10 +91,10 @@ def Subdirs(env, dirlist): env.SConscript(file, "env") def _subconf_list(dirlist): - return map(lambda x: os.path.join(x, "SConscript"), string.split(dirlist)) + return [os.path.join(x, "SConscript") for x in dirlist.split()] def StaticLibMergeMembers(local_env, libname, hackpath, files): - for file in string.split(files): + for file in files.split(): # QQQ Fix limits in grok'ed regexp tmp = re.sub(".c$", ".o", file) objname = re.sub(".cpp", ".o", tmp) @@ -121,22 +120,22 @@ def Gen_StaticLibMerge(source, target, env, for_signature): return [["ar", "cq"] + target + srclist, ["ranlib"] + target] def StaticLibrary(env, target, source): - env.StaticLibrary(target, string.split(source)) + env.StaticLibrary(target, source.split()) def SharedLibrary(env, target, source): - env.SharedLibrary(target, string.split(source)) + env.SharedLibrary(target, source.split()) def ExportHeader(env, headers): - env.Install(dir = env["EXPORT_INCLUDE"], source = string.split(headers)) + env.Install(dir = env["EXPORT_INCLUDE"], source = headers.split()) def ExportLib(env, libs): - env.Install(dir = env["EXPORT_LIB"], source = string.split(libs)) + env.Install(dir = env["EXPORT_LIB"], source = libs.split()) def InstallBin(env, bins): - env.Install(dir = env["INSTALL_BIN"], source = string.split(bins)) + env.Install(dir = env["INSTALL_BIN"], source = bins.split()) def Program(env, target, source): - env.Program(target, string.split(source)) + env.Program(target, source.split()) def AddCFlags(env, str): env.Append(CPPFLAGS = " " + str) @@ -146,13 +145,13 @@ def AddCFlags(env, str): # AddCFlags(env, str) def AddIncludeDirs(env, str): - env.Append(CPPPATH = string.split(str)) + env.Append(CPPPATH = str.split()) def AddLibs(env, str): - env.Append(LIBS = string.split(str)) + env.Append(LIBS = str.split()) def AddLibDirs(env, str): - env.Append(LIBPATH = string.split(str)) + env.Append(LIBPATH = str.split()) """) @@ -189,7 +188,6 @@ env = env.Clone() # Yes, clobber intentionally test.write(['src', 'lib_geng', 'SConscript'], """\ # --- Begin SConscript boilerplate --- -import string import sys import Mylib Import("env") @@ -233,8 +231,8 @@ for k in fromdict.keys(): except SCons.Errors.UserError: pass todict["CFLAGS"] = fromdict["CPPFLAGS"] + " " + \ - string.join(map(lambda x: "-I" + x, env["CPPPATH"])) + " " + \ - string.join(map(lambda x: "-L" + x, env["LIBPATH"])) + ' '.join(["-I" + x for x in env["CPPPATH"]]) + " " + \ + ' '.join(["-L" + x for x in env["LIBPATH"]]) todict["CXXFLAGS"] = todict["CFLAGS"] generated_hdrs = "libg_gx.h libg_gy.h libg_gz.h" @@ -243,9 +241,9 @@ static_hdrs = "libg_w.h" exported_hdrs = static_hdrs lib_name = "g" lib_fullname = env.subst("${LIBPREFIX}g${LIBSUFFIX}") -lib_srcs = string.split("libg_1.c libg_2.c libg_3.c") +lib_srcs = "libg_1.c libg_2.c libg_3.c".split() import re -lib_objs = map(lambda x: re.sub("\.c$", ".o", x), lib_srcs) +lib_objs = [re.sub("\.c$", ".o", x) for x in lib_srcs] Mylib.ExportHeader(env, exported_hdrs) Mylib.ExportLib(env, lib_fullname) @@ -275,11 +273,11 @@ cmd_justlib = "%s %s -C ${SOURCES[0].dir}" % (escape(sys.executable), # # SCons bug?? -env.Command(string.split(generated_hdrs), +env.Command(generated_hdrs.split(), ["MAKE-HEADER.py"], cmd_generated) recurse_env.Command([lib_fullname] + lib_objs, - lib_srcs + string.split(generated_hdrs + " " + static_hdrs), + lib_srcs + (generated_hdrs + " " + static_hdrs).split(), cmd_justlib) """) |