summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaweł Tomulik <ptomulik@meil.pw.edu.pl>2018-11-13 21:25:47 (GMT)
committerPaweł Tomulik <ptomulik@meil.pw.edu.pl>2018-11-13 21:25:47 (GMT)
commit61078bba32c72a5389a29b12b99f7ea74a095015 (patch)
treec4e5f563fdafa3ad71bbaba4039b0ca3e2b5faec
parent6e4c93ae4f130a4566ee58e7a6e48695a51f1bf8 (diff)
downloadSCons-61078bba32c72a5389a29b12b99f7ea74a095015.zip
SCons-61078bba32c72a5389a29b12b99f7ea74a095015.tar.gz
SCons-61078bba32c72a5389a29b12b99f7ea74a095015.tar.bz2
refine get_env_bool() docstrings
-rw-r--r--src/engine/SCons/Util.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py
index f20aae3..07f62ea 100644
--- a/src/engine/SCons/Util.py
+++ b/src/engine/SCons/Util.py
@@ -1598,16 +1598,16 @@ def cmp(a, b):
def get_env_bool(env, name, default=False):
- """
- Get a value of an environment variable converting it to boolean.
-
- - FOO=1, FOO=123, FOO=true, FOO=yes, FOO=y, FOO=on are examples of ``True``
- values.
- - FOO=0, FOO=false, FOO=no, FOO=n, FOO=off are examples of ``False``
- values.
+ """Get a value of env[name] converted to boolean. The value of env[name] is
+ interpreted as follows: 'true', 'yes', 'y', 'on' (case insensitive) and
+ anything convertible to int that yields non-zero integer are True values;
+ '0', 'false', 'no', 'n' and 'off' (case insensitive) are False values. For
+ all other cases, default value is returned.
- If a variable can't be converted to a boolean, default value is returned
- (``False`` by default).
+ :Parameters:
+ - `env` - dict or dict-like object, a convainer with variables
+ - `name` - name of the variable in env to be returned
+ - `default` - returned when env[name] does not exist or can't be converted to bool
"""
try:
var = env[name]