ó àqLc@s¾dZdZddlZddlZddlZddlZddlZddl Zddl m Z ddl m Z ddl m Z ddl m Z ddlmZd efd „ƒYZdS( sŠengine.SCons.Variables This file defines the Variables class that is used to add user-friendly customizable variables to an SCons build. sEsrc/engine/SCons/Variables/__init__.py 5023 2010/06/14 22:05:46 sconsiÿÿÿÿN(t BoolVariable(t EnumVariable(t ListVariable(tPackageVariable(t PathVariablet VariablescBsžeZdZgidd„Zddddd„Zd„Zddddd„Zd„Zdd„Z d„Z d „Z dd „Z d Z d Zgd „ZRS(icCs|g|_||_tjj|ƒs?|r6|g}q?g}n||_i|_|rxtj}tjsx|t_qxndS(sà files - [optional] List of option configuration files to load (backward compatibility) If a single string is passed it is automatically placed in a file list N( toptionstargstSConstUtiltis_ListtfilestunknownRtinstance(tselfR Rt is_global((sh/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/__init__.pyt__init__5s        tc Csídtfd„ƒY}|ƒ}tjj|ƒsCtjj|ƒr`|d|_|d|_n||_|g|_||_||_||_ ||_ |j j |ƒx=t |jƒ|jgD]"}||jkrÃ|j|=qÃqÃWdS(NtVariablecBseZRS((t__name__t __module__(((sh/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/__init__.pyRMsii(tobjectRR R tis_Tupletkeytaliasesthelptdefaultt validatort converterRtappendtlistR ( RRRRRRRtoptiontalias((sh/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/__init__.pyt_do_addLs $        cCsg|jD]}|j^q S(s6 Returns the keywords for the options (RR(Rto((sh/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/__init__.pytkeysgscKs”tjj|ƒs!t|tƒr2|j|ŒdStjj|ƒ sXtjj|ƒ rwtj j dt |ƒƒ‚n|j|||||ƒdS(sß Add an option. key - the name of the variable, or a list or tuple of arguments help - optional help text for the options default - optional default value validator - optional function that is called to validate the option's value Called with (key, value, environment) converter - optional function that is called to convert the option's value before putting it in the environment. Ns Illegal Variables.Add() key `%s'( RR R t isinstancettupleR!t is_Stringt Environmenttis_valid_construction_vartErrorst UserErrortstr(RRRRRRtkw((sh/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/__init__.pytAddms ! cGs"x|D]}|j|ŒqWdS(s‹ Add a list of options. Each list element is a tuple/list of arguments to be passed on to the underlying method for adding options. Example: opt.AddVariables( ('debug', '', 0), ('CC', 'The C compiler'), ('VALIDATE', 'An option for testing validation', 'notset', validator, None), ) N(R!(RtoptlistR"((sh/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/__init__.pyt AddVariables„s c Bsài}x3|jD](}|jdk r|j||jtclosetIOErrorR)R*( RRDRBtfhRRGtpreparet defaultValRI((sh/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/__init__.pytSaveás4       ('  cCsn|r!t|jdd„ƒ}n |j}||d„}gt||ƒD]}|rI|^qI}dj|ƒS(sœ Generate the help text for the options. env - an environment that is used to get the current values of the options. RcSs|jS(N(R(RI((sh/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/__init__.pytscSsV|j|kr(|jd|jƒ}nd}|j||j|j|j||jƒS(Ns${%s}(RR?R1tFormatVariableHelpTextRRR(toptRRBtactual((sh/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/__init__.pytformatsR(tsortedRtmaptjoin(RRBtsortRR^t_ftlines((sh/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/__init__.pytGenerateHelpTexts  (s' %s: %s default: %s actual: %s s7 %s: %s default: %s actual: %s aliases: %s cCslg|D]}||kr|^q}t|ƒdkrN|j||||fS|j|||||fSdS(Ni(tlenR^tformat_(RRBRRRR]Rta((sh/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/__init__.pyR[,s%N(RRR1R RR!R#R-R/RJRKRYReR^RgR[(((sh/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/__init__.pyR.s   C  1 (t__doc__t __revision__tos.pathR2R7tSCons.EnvironmentRt SCons.Errorst SCons.UtiltSCons.WarningsRRRRRRR(((sh/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Variables/__init__.pyts