summaryrefslogtreecommitdiff
path: root/src/engine/SCons/Scanner/Dir.py
diff options
context:
space:
mode:
authorLuca Falavigna <dktrkranz@debian.org>2010-06-15 14:28:28 +0000
committerLuca Falavigna <dktrkranz@debian.org>2010-06-15 14:28:28 +0000
commit0ed55e71a9f4b9cda836c6a4a5408cece60db0c6 (patch)
treeb1e82f6e428ac15ed9b4de93e48d8079420d537d /src/engine/SCons/Scanner/Dir.py
parentfe00e4f75ba00298c30d6854b245c2a42c6542b8 (diff)
parent738149c9bfb9965d013d01ef99f9bb1c2819e7e8 (diff)
Merge commit 'upstream/2.0.0'
Diffstat (limited to 'src/engine/SCons/Scanner/Dir.py')
-rw-r--r--src/engine/SCons/Scanner/Dir.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/engine/SCons/Scanner/Dir.py b/src/engine/SCons/Scanner/Dir.py
index bb25324..172aa62 100644
--- a/src/engine/SCons/Scanner/Dir.py
+++ b/src/engine/SCons/Scanner/Dir.py
@@ -19,30 +19,29 @@
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-__revision__ = "src/engine/SCons/Scanner/Dir.py 4720 2010/03/24 03:14:11 jars"
+__revision__ = "src/engine/SCons/Scanner/Dir.py 5023 2010/06/14 22:05:46 scons"
import SCons.Node.FS
import SCons.Scanner
def only_dirs(nodes):
is_Dir = lambda n: isinstance(n.disambiguate(), SCons.Node.FS.Dir)
- return filter(is_Dir, nodes)
+ return list(filter(is_Dir, nodes))
def DirScanner(**kw):
"""Return a prototype Scanner instance for scanning
directories for on-disk files"""
kw['node_factory'] = SCons.Node.FS.Entry
kw['recursive'] = only_dirs
- return apply(SCons.Scanner.Base, (scan_on_disk, "DirScanner"), kw)
+ return SCons.Scanner.Base(scan_on_disk, "DirScanner", **kw)
def DirEntryScanner(**kw):
"""Return a prototype Scanner instance for "scanning"
directory Nodes for their in-memory entries"""
kw['node_factory'] = SCons.Node.FS.Entry
kw['recursive'] = None
- return apply(SCons.Scanner.Base, (scan_in_memory, "DirEntryScanner"), kw)
+ return SCons.Scanner.Base(scan_in_memory, "DirEntryScanner", **kw)
skip_entry = {}
@@ -67,7 +66,7 @@ for skip in skip_entry_list:
skip_entry[skip] = 1
skip_entry[SCons.Node.FS._my_normcase(skip)] = 1
-do_not_scan = lambda k: not skip_entry.has_key(k)
+do_not_scan = lambda k: k not in skip_entry
def scan_on_disk(node, env, path=()):
"""
@@ -100,9 +99,8 @@ def scan_in_memory(node, env, path=()):
# mixed Node types (Dirs and Files, for example) has a Dir as
# the first entry.
return []
- entry_list = filter(do_not_scan, entries.keys())
- entry_list.sort()
- return map(lambda n, e=entries: e[n], entry_list)
+ entry_list = sorted(filter(do_not_scan, list(entries.keys())))
+ return [entries[n] for n in entry_list]
# Local Variables:
# tab-width:4