Package SCons :: Package Node :: Module FS :: Class FileFinder
[hide private]
[frames] | no frames]

Class FileFinder

source code

object --+
         |
        FileFinder

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
filedir_lookup(self, p, fd=None)
A helper method for find_file() that looks up a directory for a file we're trying to find. This only creates the Dir Node if it exists on-disk, since if the directory doesn't exist we know we won't find any files in it... :-)
source code
 
_find_file_key(self, filename, paths, verbose=None) source code
 
find_file(self, filename, paths, verbose=None)
Find a node corresponding to either a derived file or a file that exists already.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__
(inherited documentation)

filedir_lookup(self, p, fd=None)

source code 

A helper method for find_file() that looks up a directory for a file we're trying to find. This only creates the Dir Node if it exists on-disk, since if the directory doesn't exist we know we won't find any files in it... :-)

It would be more compact to just use this as a nested function with a default keyword argument (see the commented-out version below), but that doesn't work unless you have nested scopes, so we define it here just so this work under Python 1.5.2.

find_file(self, filename, paths, verbose=None)

source code 

Find a node corresponding to either a derived file or a file that exists already.

Only the first file found is returned, and none is returned if no file is found.

filename: A filename to find paths: A list of directory path nodes to search in. Can be represented as a list, a tuple, or a callable that is called with no arguments and returns the list or tuple.

returns The node created from the found file.

Decorators:
  • @SCons.Memoize.CountDictCall(_find_file_key)