diff options
author | Steven Knight <knight@baldmt.com> | 2010-05-17 02:01:56 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2010-05-17 02:01:56 (GMT) |
commit | 4f3794639fbc0644c1b4ee803bb4880730d4e024 (patch) | |
tree | 60da75528d399434dbfe42206fffcdfaef494f8b | |
parent | a64cfe44e626ccb956a1b4c47e6d979519b3c8a2 (diff) | |
download | SCons-4f3794639fbc0644c1b4ee803bb4880730d4e024.zip SCons-4f3794639fbc0644c1b4ee803bb4880730d4e024.tar.gz SCons-4f3794639fbc0644c1b4ee803bb4880730d4e024.tar.bz2 |
Convert old-style classes in Node/FS.py to new-style classes. Refactor assignment to FS.DiskChecker.__call__.
-rw-r--r-- | src/engine/SCons/Node/FS.py | 20 |
1 files 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: |