Package SCons :: Package Variables :: Module BoolVariable'
[hide private]
[frames] | no frames]

Module BoolVariable'

source code

engine.SCons.Variables.BoolVariable

This file defines the option type for SCons implementing true/false values.

Usage example:

  opts = Variables()
  opts.Add(BoolVariable('embedded', 'build for an embedded system', 0))
  ...
  if env['embedded'] == 1:
    ...

Functions [hide private]
 
BoolVariable(key, help, default)
The input parameters describe a boolen option, thus they are returned with the correct converter and validator appended. The 'help' text will by appended by '(yes|no) to show the valid valued. The result is usable for input to opts.Add().
source code
 
_text2bool(val)
Converts strings to True/False depending on the 'truth' expressed by the string. If the string can't be converted, the original value will be returned.
source code
 
_validator(key, val, env)
Validates the given value to be either '0' or '1'.
source code
Variables [hide private]
  __false_strings = ('n', 'no', 'false', 'f', '0', 'off', 'none')
  __package__ = 'SCons.Variables'
  __revision__ = 'src/engine/SCons/Variables/BoolVariable.py 20...
  __true_strings = ('y', 'yes', 'true', 't', '1', 'on', 'all')
Function Details [hide private]

_text2bool(val)

source code 

Converts strings to True/False depending on the 'truth' expressed by the string. If the string can't be converted, the original value will be returned.

See '__true_strings' and '__false_strings' for values considered 'true' or 'false respectivly.

This is usable as 'converter' for SCons' Variables.

_validator(key, val, env)

source code 

Validates the given value to be either '0' or '1'.

This is usable as 'validator' for SCons' Variables.


Variables Details [hide private]

__revision__

Value:
'src/engine/SCons/Variables/BoolVariable.py  2014/07/05 09:42:21 garyo\
'