diff options
author | Steven Knight <knight@baldmt.com> | 2010-04-18 14:03:36 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2010-04-18 14:03:36 (GMT) |
commit | ae1e7c742dcd1ed0b521640455794172fe275c65 (patch) | |
tree | 15f668e70035c926caa062d91f2fd806b7b65528 /src/engine/SCons/Tool/javac.py | |
parent | e254cdf344ed0a466661b319dc019f2400ad12f3 (diff) | |
download | SCons-ae1e7c742dcd1ed0b521640455794172fe275c65.zip SCons-ae1e7c742dcd1ed0b521640455794172fe275c65.tar.gz SCons-ae1e7c742dcd1ed0b521640455794172fe275c65.tar.bz2 |
Replace remaining os.path.walk() calls with os.walk().
Diffstat (limited to 'src/engine/SCons/Tool/javac.py')
-rw-r--r-- | src/engine/SCons/Tool/javac.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/engine/SCons/Tool/javac.py b/src/engine/SCons/Tool/javac.py index ef4bd5b..6cc0779 100644 --- a/src/engine/SCons/Tool/javac.py +++ b/src/engine/SCons/Tool/javac.py @@ -73,15 +73,17 @@ def emit_java_classes(target, source, env): slist.append(entry) elif isinstance(entry, SCons.Node.FS.Dir): result = SCons.Util.OrderedDict() - def visit(arg, dirname, names, dirnode=entry.rdir()): - java_files = sorted([n for n in names if _my_normcase(n[-len(js):]) == js]) - mydir = dirnode.Dir(dirname) + dirnode = entry.rdir() + def find_java_files(arg, dirpath, filenames): + java_files = sorted([n for n in filenames + if _my_normcase(n).endswith(js)]) + mydir = dirnode.Dir(dirpath) java_paths = [mydir.File(f) for f in java_files] for jp in java_paths: arg[jp] = True - - os.path.walk(entry.rdir().get_abspath(), visit, result) - entry.walk(visit, result) + for dirpath, dirnames, filenames in os.walk(dirnode.get_abspath()): + find_java_files(result, dirpath, filenames) + entry.walk(find_java_files, result) slist.extend(result.keys()) else: |