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

Class FileFinder


Method Summary
  __init__(self)
  filedir_lookup(self, p, fd)
A helper method for find_file() that looks up a directory for a file we're trying to find.
  find_file(self, filename, paths, verbose)
find_file(str, [Dir()]) -> [nodes] filename - a filename to find paths - a list of directory path *nodes* to search in.

Class Variable Summary
list memoizer_counters = [<SCons.Memoize.CountDict instance a...

Method Details

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... :-)

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 this works work under Python 1.5.2.

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

find_file(str, [Dir()]) -> [nodes]

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.

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.

Class Variable Details

memoizer_counters

Type:
list
Value:
[<SCons.Memoize.CountDict instance at 0xa3aea8>]                       

Generated by Epydoc 2.1 on Wed Dec 12 09:39:31 2007 http://epydoc.sf.net