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 boolean 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 3a4...
  __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 respectively.

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 3a41ed6b288cee8d085373ad7f\
a02894e1903864 2019-01-23 17:30:35 bdeegan'