Ñò àqLc@s\dZdZdgZddkZddkZddkZdefd„ƒYZeƒZ dS(sòSCons.Variables.PathVariable This file defines an option type for SCons implementing path settings. To be used whenever a a user-specified path override should be allowed. Arguments to PathVariable are: option-name = name of this option on the command line (e.g. "prefix") option-help = help string for option option-dflt = default value for this option validator = [optional] validator for option value. Predefined validators are: PathAccept -- accepts any path setting; no validation PathIsDir -- path must be an existing directory PathIsDirCreate -- path must be a dir; will create PathIsFile -- path must be a file PathExists -- path must exist (any type) [default] The validator is a function that is called and which should return True or False to indicate if the path is valid. The arguments to the validator function are: (key, val, env). The key is the name of the option, the val is the path specified for the option, and the env is the env to which the Otions have been added. Usage example: Examples: prefix=/usr/local opts = Variables() opts = Variables() opts.Add(PathVariable('qtdir', 'where the root of Qt is installed', qtdir, PathIsDir)) opts.Add(PathVariable('qt_includes', 'where the Qt includes are installed', '$qtdir/includes', PathIsDirCreate)) opts.Add(PathVariable('qt_libraries', 'where the Qt library is installed', '$qtdir/lib')) sIsrc/engine/SCons/Variables/PathVariable.py 5023 2010/06/14 22:05:46 sconst PathVariableiÿÿÿÿNt_PathVariableClasscBsAeZd„Zd„Zd„Zd„Zd„Zdd„ZRS(cCsdS(s#Accepts any path, no checking done.N((tselftkeytvaltenv((sl/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/PathVariable.pyt PathAcceptRscCsZtii|ƒpCtii|ƒo d}nd}tii|||fƒ‚ndS(s*Validator to check if Path is a directory.s*Directory path for option %s is a file: %ss/Directory path for option %s does not exist: %sN(tostpathtisdirtisfiletSConstErrorst UserError(RRRRtm((sl/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/PathVariable.pyt PathIsDirVs  cCsatii|ƒo&d}tii|||fƒ‚ntii|ƒpti|ƒndS(sWValidator to check if Path is a directory, creating it if it does not exist.s1Path for option %s is a file, not a directory: %sN(RRR R R R R tmakedirs(RRRRR((sl/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/PathVariable.pytPathIsDirCreate_s  cCsZtii|ƒpCtii|ƒo d}nd}tii|||fƒ‚ndS(s$validator to check if Path is a files*File path for option %s is a directory: %ss*File path for option %s does not exist: %sN(RRR R R R R (RRRRR((sl/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/PathVariable.pyt PathIsFilehs  cCs=tii|ƒp&d}tii|||fƒ‚ndS(s!validator to check if Path existss%Path for option %s does not exist: %sN(RRtexistsR R R (RRRRR((sl/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/PathVariable.pyt PathExistsqscCsƒ|djo |i}ntii|ƒptii|ƒo"|d||df||dfS|d||f||dfSdS(s The input parameters describe a 'path list' option, thus they are returned with the correct converter and validator appended. The result is usable for input to opts.Add() . The 'default' option specifies the default path to use if the user does not specify an override with this option. validator is a validator, see this file for examples s%s ( /path/to/%s )iN(tNoneRR tUtiltis_Listtis_Tuple(RRthelptdefaultt validator((sl/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/PathVariable.pyt__call__ws  & N( t__name__t __module__RRRRRRR(((sl/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/PathVariable.pyRPs   ( t__doc__t __revision__t__all__Rtos.patht SCons.ErrorsR tobjectRR(((sl/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/PathVariable.pyt.s    =