From 4f3794639fbc0644c1b4ee803bb4880730d4e024 Mon Sep 17 00:00:00 2001 From: Steven Knight <knight@baldmt.com> Date: Mon, 17 May 2010 02:01:56 +0000 Subject: Convert old-style classes in Node/FS.py to new-style classes. Refactor assignment to FS.DiskChecker.__call__. --- src/engine/SCons/Node/FS.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index 7bae6c1..9c73d70 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -278,7 +278,7 @@ def get_MkdirBuilder(): name = "MkdirBuilder") return MkdirBuilder -class _Null: +class _Null(object): pass _null = _Null() @@ -321,21 +321,19 @@ else: -class DiskChecker: +class DiskChecker(object): def __init__(self, type, do, ignore): self.type = type self.do = do self.ignore = ignore - self.set_do() - def set_do(self): - self.__call__ = self.do - def set_ignore(self): - self.__call__ = self.ignore + self.func = do + def __call__(self, *args, **kw): + return self.func(*args, **kw) def set(self, list): if self.type in list: - self.set_do() + self.func = self.do else: - self.set_ignore() + self.func = self.ignore def do_diskcheck_match(node, predicate, errorfmt): result = predicate() @@ -954,7 +952,7 @@ class Entry(Base): _classEntry = Entry -class LocalFS: +class LocalFS(object): if SCons.Memoize.use_memoizer: __metaclass__ = SCons.Memoize.Memoized_Metaclass @@ -2955,7 +2953,7 @@ def get_default_fs(): default_fs = FS() return default_fs -class FileFinder: +class FileFinder(object): """ """ if SCons.Memoize.use_memoizer: -- cgit v0.12