diff options
author | Greg Noel <GregNoel@tigris.org> | 2010-03-25 04:14:28 (GMT) |
---|---|---|
committer | Greg Noel <GregNoel@tigris.org> | 2010-03-25 04:14:28 (GMT) |
commit | 22d352500f1cd6bd0c53d788a5dc44a1fefa676e (patch) | |
tree | 0984fd581082c27cfbfbb7f94d5751b0e6fd2741 /src/engine/SCons/Tool/swig.py | |
parent | 75ac32ac8e32076e25b72a19eb56340cc585fa4e (diff) | |
download | SCons-22d352500f1cd6bd0c53d788a5dc44a1fefa676e.zip SCons-22d352500f1cd6bd0c53d788a5dc44a1fefa676e.tar.gz SCons-22d352500f1cd6bd0c53d788a5dc44a1fefa676e.tar.bz2 |
Move 2.0 changes collected in branches/pending back to trunk for further
development. Note that this set of changes is NOT backward-compatible;
the trunk no longer works with Python 1.5.2, 2.0, or 2.1.
Diffstat (limited to 'src/engine/SCons/Tool/swig.py')
-rw-r--r-- | src/engine/SCons/Tool/swig.py | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/engine/SCons/Tool/swig.py b/src/engine/SCons/Tool/swig.py index c473b10..c6815f7 100644 --- a/src/engine/SCons/Tool/swig.py +++ b/src/engine/SCons/Tool/swig.py @@ -35,7 +35,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os.path import re -import string import subprocess import SCons.Action @@ -72,7 +71,7 @@ def _find_modules(src): for m in matches: mnames.append(m[2]) - directors = directors or string.find(m[0], 'directors') >= 0 + directors = directors or m[0].find('directors') >= 0 return mnames, directors def _add_director_header_targets(target, env): @@ -97,29 +96,26 @@ def _swigEmitter(target, source, env): mnames, directors = _find_modules(src) if directors: _add_director_header_targets(target, env) - python_files = map(lambda m: m + ".py", mnames) + python_files = [m + ".py" for m in mnames] outdir = env.subst('$SWIGOUTDIR', target=target, source=source) # .py files should be generated in SWIGOUTDIR if specified, # otherwise in the same directory as the target if outdir: - python_files = map(lambda j, o=outdir, e=env: - e.fs.File(os.path.join(o, j)), - python_files) + python_files = [env.fs.File(os.path.join(outdir, j)) for j in python_files] else: - python_files = map(lambda m, d=target[0].dir: - d.File(m), python_files) + python_files = [target[0].dir.File(m) for m in python_files] target.extend(python_files) if "-java" in flags: if mnames is None: mnames, directors = _find_modules(src) if directors: _add_director_header_targets(target, env) - java_files = map(lambda m: [m + ".java", m + "JNI.java"], mnames) + java_files = [[m + ".java", m + "JNI.java"] for m in mnames] java_files = SCons.Util.flatten(java_files) outdir = env.subst('$SWIGOUTDIR', target=target, source=source) if outdir: - java_files = map(lambda j, o=outdir: os.path.join(o, j), java_files) - java_files = map(env.fs.File, java_files) + java_files = [os.path.join(outdir, j) for j in java_files] + java_files = list(map(env.fs.File, java_files)) for jf in java_files: t_from_s = lambda t, p, s, x: t.dir SCons.Util.AddMethod(jf, t_from_s, 'target_from_source') |