ó àqLc@sÝdZdZddlZddlZddlZdefd„ƒYZeZd„Z defd„ƒYZ d efd „ƒYZ d e fd „ƒYZ d e fd„ƒYZ de fd„ƒYZdefd„ƒYZdS(sQSCons.Scanner The Scanner package for the SCons software construction utility. sCsrc/engine/SCons/Scanner/__init__.py 5023 2010/06/14 22:05:46 sconsiÿÿÿÿNt_NullcBseZRS((t__name__t __module__(((sf/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Scanner/__init__.pyR&scOs6tjj|ƒr"t|||ŽSt|||ŽSdS(sÌ Public interface factory function for creating different types of Scanners based on the different types of "functions" that may be supplied. TODO: Deprecate this some day. We've moved the functionality inside the Base class and really don't need this factory function any more. It was, however, used by some of our Tool modules, so the call probably ended up in various people's custom modules patterned on SCons code. N(tSConstUtiltis_DicttSelectortBase(tfunctiontargstkw((sf/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Scanner/__init__.pytScanner-s t FindPathDirscBs,eZdZd„Zddddd„ZRS(soA class to bind a specific *PATH variable name to a function that will return all of the *path directories.cCs ||_dS(N(tvariable(tselfR ((sf/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Scanner/__init__.pyt__init__CscCsxddl}y||j}Wntk r1dSX|pA|jj}|jj|ƒj|||ƒ}t|j|ƒƒS(Niÿÿÿÿ(( tSCons.PathListR tKeyErrortfst_cwdtPathListt subst_pathttuplet Rfindalldirs(RtenvtdirttargettsourcetargumentRtpath((sf/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Scanner/__init__.pyt__call__Es  !N(RRt__doc__RtNoneR(((sf/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Scanner/__init__.pyR @s Rc Bs°eZdZdeedejjjdddd„Z dddd„Z dd„Z d„Z d„Z d„Zd„Zdd „Zd „Zd „Zd „ZeZd „ZRS(s~ The base class for dependency scanners. This implements straightforward, single-pass scanning of a single file. tNONEc CsÁ||_||_||_||_|tkr`tjj|ƒrWt|j ƒƒ}q`g}n||_ ||_ ||_ ||_ t| ƒrœ| |_n!| r±|j|_n |j|_dS(s© Construct a new scanner object given a scanner function. 'function' - a scanner function taking two or three arguments and returning a list of strings. 'name' - a name for identifying this scanner object. 'argument' - an optional argument that, if specified, will be passed to both the scanner function and the path_function. 'skeys' - an optional list argument that can be used to determine which scanner should be used for a given Node. In the case of File nodes, for example, the 'skeys' would be file suffixes. 'path_function' - a function that takes four or five arguments (a construction environment, Node for the directory containing the SConscript file that defined the primary target, list of target nodes, list of source nodes, and optional argument for this instance) and returns a tuple of the directories that can be searched for implicit dependency files. May also return a callable() which is called with no args and returns the tuple (supporting Bindable class). 'node_class' - the class of Nodes which this scan will return. If node_class is None, then this scanner will not enforce any Node conversion and will return the raw results from the underlying scanner function. 'node_factory' - the factory function to be called to translate the raw results returned by the scanner function into the expected node_class objects. 'scan_check' - a function to be called to first check whether this node really needs to be scanned. 'recursive' - specifies that this scanner should be invoked recursively on all of the implicit dependencies it returns (the canonical example being #include lines in C source files). May be a callable, which will be called to filter the list of nodes found to select a subset for recursive scanning (the canonical example being only recursively scanning subdirectories within a directory). The scanner function's first argument will be a Node that should be scanned for dependencies, the second argument will be an Environment object, the third argument will be the tuple of paths returned by the path_function, and the fourth argument will be the value passed into 'argument', and the returned list should contain the Nodes for all the direct dependencies of the file. Examples: s = Scanner(my_scanner_function) s = Scanner(function = my_scanner_function) s = Scanner(function = my_scanner_function, argument = 'foo') N(Rt path_functiontnameRt_nullRRRtlisttkeystskeyst node_classt node_factoryt scan_checktcallablet recurse_nodest_recurse_all_nodest_recurse_no_nodes( RRR#RR'R"R(R)R*t recursive((sf/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Scanner/__init__.pyRXs"N            cCsR|js dS|jtk r8|j|||||jƒS|j||||ƒSdS(N((R"RR$(RRRRR((sf/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Scanner/__init__.pyR¼s  c Csþ|jr |j||ƒ r gS|j|ƒ}|jtk r\|j||||jƒ}n|j|||ƒ}i}t|dƒr–|j|deZdZd„Zd„Zd„Zd„Zdd„ZRS(s« A Scanner subclass to contain the common logic for classic CPP-style include scanning, but which can be customized to use different regular expressions to find the includes. Note that in order for this to work "out of the box" (without overriding the find_include() and sort_key() methods), the regular expression passed to the constructor must return the name of the include file in group 0. cOsvtj|tjƒ|_d|d„}||ds    » H