summaryrefslogtreecommitdiff
path: root/src/engine/SCons/Tool/swig.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/SCons/Tool/swig.py')
-rw-r--r--src/engine/SCons/Tool/swig.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/engine/SCons/Tool/swig.py b/src/engine/SCons/Tool/swig.py
index 8ad4596..85aab70 100644
--- a/src/engine/SCons/Tool/swig.py
+++ b/src/engine/SCons/Tool/swig.py
@@ -31,11 +31,10 @@ selection method.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/swig.py 4720 2010/03/24 03:14:11 jars"
+__revision__ = "src/engine/SCons/Tool/swig.py 5023 2010/06/14 22:05:46 scons"
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')