diff options
author | Steven Knight <knight@baldmt.com> | 2010-04-16 13:40:49 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2010-04-16 13:40:49 (GMT) |
commit | ded0f52f11f5c97959ee8070a2687ecb14e69e3f (patch) | |
tree | 62ceb50351ad2bb0343b1f12b291449f8203dfba /bin/scons-doc.py | |
parent | c06950cad4c02ba6b759c1cbd65cfb52ab6868c3 (diff) | |
download | SCons-ded0f52f11f5c97959ee8070a2687ecb14e69e3f.zip SCons-ded0f52f11f5c97959ee8070a2687ecb14e69e3f.tar.gz SCons-ded0f52f11f5c97959ee8070a2687ecb14e69e3f.tar.bz2 |
Refactory bin/* utilities to use os.walk() instead of os.path.walk().
Diffstat (limited to 'bin/scons-doc.py')
-rw-r--r-- | bin/scons-doc.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/bin/scons-doc.py b/bin/scons-doc.py index f7a3a23..7e49cbe 100644 --- a/bin/scons-doc.py +++ b/bin/scons-doc.py @@ -322,16 +322,13 @@ def JavaHCom(target, source, env): for t, s in zip(tlist, slist): open(t, "wb").write(open(s, "rb").read()) -def find_class_files(arg, dirname, names): - class_files = filter(lambda n: n[-6:] == '.class', names) - paths = map(lambda n: os.path.join(dirname, n), class_files) - arg.extend(paths) - def JarCom(target, source, env): target = str(target[0]) class_files = [] for src in map(str, source): - os.path.walk(src, find_class_files, class_files) + for dirpath, dirnames, filenames in os.walk(src): + class_files.extend([ os.path.join(dirpath, f) + for f in filenames if f.endswith('.class') ]) f = open(target, "wb") for cf in class_files: f.write(open(cf, "rb").read()) |