summaryrefslogtreecommitdiff
path: root/engine/SCons/Variables
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2016-04-10 16:42:40 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2016-04-10 16:42:40 +0200
commit70639bffe44444b5faee83772cc3c73dc2e46fed (patch)
tree124bf797d20d37bf34c54e5a5a668c2e7cc2cea0 /engine/SCons/Variables
parent6a570afd28bccdb118edde36488ba9834494d6c7 (diff)
Imported Upstream version 2.5.0upstream/2.5.0
Diffstat (limited to 'engine/SCons/Variables')
-rw-r--r--engine/SCons/Variables/BoolVariable.py8
-rw-r--r--engine/SCons/Variables/EnumVariable.py8
-rw-r--r--engine/SCons/Variables/ListVariable.py12
-rw-r--r--engine/SCons/Variables/PackageVariable.py14
-rw-r--r--engine/SCons/Variables/PathVariable.py13
-rw-r--r--engine/SCons/Variables/__init__.py11
6 files changed, 35 insertions, 31 deletions
diff --git a/engine/SCons/Variables/BoolVariable.py b/engine/SCons/Variables/BoolVariable.py
index c7310a7..e6ad86b 100644
--- a/engine/SCons/Variables/BoolVariable.py
+++ b/engine/SCons/Variables/BoolVariable.py
@@ -12,7 +12,7 @@ Usage example:
"""
#
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -34,7 +34,7 @@ Usage example:
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Variables/BoolVariable.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "src/engine/SCons/Variables/BoolVariable.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__all__ = ['BoolVariable',]
@@ -51,7 +51,7 @@ def _text2bool(val):
will be returned.
See '__true_strings' and '__false_strings' for values considered
- 'true' or 'false respectivly.
+ 'true' or 'false respectively.
This is usable as 'converter' for SCons' Variables.
"""
@@ -74,7 +74,7 @@ def _validator(key, val, env):
def BoolVariable(key, help, default):
"""
- The input parameters describe a boolen option, thus they are
+ 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().
diff --git a/engine/SCons/Variables/EnumVariable.py b/engine/SCons/Variables/EnumVariable.py
index 734d48c..5fd4101 100644
--- a/engine/SCons/Variables/EnumVariable.py
+++ b/engine/SCons/Variables/EnumVariable.py
@@ -15,7 +15,7 @@ Usage example:
"""
#
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -37,7 +37,7 @@ Usage example:
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Variables/EnumVariable.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "src/engine/SCons/Variables/EnumVariable.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__all__ = ['EnumVariable',]
@@ -52,7 +52,7 @@ def _validator(key, val, env, vals):
def EnumVariable(key, help, default, allowed_values, map={}, ignorecase=0):
"""
- The input parameters describe a option with only certain values
+ The input parameters describe an option with only certain values
allowed. They are returned with an appropriate converter and
validator appended. The result is usable for input to
Variables.Add().
@@ -65,7 +65,7 @@ def EnumVariable(key, help, default, allowed_values, map={}, ignorecase=0):
for this option.
The 'map'-dictionary may be used for converting the input value
- into canonical values (eg. for aliases).
+ into canonical values (e.g. for aliases).
'ignorecase' defines the behaviour of the validator:
diff --git a/engine/SCons/Variables/ListVariable.py b/engine/SCons/Variables/ListVariable.py
index 5541f30..8e31d88 100644
--- a/engine/SCons/Variables/ListVariable.py
+++ b/engine/SCons/Variables/ListVariable.py
@@ -4,7 +4,7 @@ This file defines the option type for SCons implementing 'lists'.
A 'list' option may either be 'all', 'none' or a list of names
separated by comma. After the option has been processed, the option
-value holds either the named list elements, all list elemens or no
+value holds either the named list elements, all list elements or no
list elements at all.
Usage example:
@@ -25,7 +25,7 @@ Usage example:
"""
#
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -46,9 +46,9 @@ Usage example:
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-__revision__ = "src/engine/SCons/Variables/ListVariable.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "src/engine/SCons/Variables/ListVariable.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
-# Know Bug: This should behave like a Set-Type, but does not really,
+# Known Bug: This should behave like a Set-Type, but does not really,
# since elements can occur twice.
__all__ = ['ListVariable',]
@@ -106,14 +106,14 @@ def _converter(val, allowedElems, mapdict):
## def _validator(key, val, env):
## """
## """
-## # todo: write validater for pgk list
+## # todo: write validator for pgk list
## return 1
def ListVariable(key, help, default, names, map={}):
"""
The input parameters describe a 'package list' option, thus they
- are returned with the correct converter and validater appended. The
+ are returned with the correct converter and validator appended. The
result is usable for input to opts.Add() .
A 'package list' option may either be 'all', 'none' or a list of
diff --git a/engine/SCons/Variables/PackageVariable.py b/engine/SCons/Variables/PackageVariable.py
index a0244e4..44d87cc 100644
--- a/engine/SCons/Variables/PackageVariable.py
+++ b/engine/SCons/Variables/PackageVariable.py
@@ -11,7 +11,7 @@ Usage example:
Examples:
x11=no (disables X11 support)
x11=yes (will search for the package installation dir)
- x11=/usr/local/X11 (will check this path for existance)
+ x11=/usr/local/X11 (will check this path for existence)
To replace autoconf's --with-xxx=yyy
@@ -28,7 +28,7 @@ Usage example:
"""
#
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -50,7 +50,7 @@ Usage example:
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Variables/PackageVariable.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "src/engine/SCons/Variables/PackageVariable.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__all__ = ['PackageVariable',]
@@ -70,10 +70,10 @@ def _converter(val):
def _validator(key, val, env, searchfunc):
- # NB: searchfunc is currenty undocumented and unsupported
+ # NB: searchfunc is currently undocumented and unsupported
"""
"""
- # todo: write validator, check for path
+ # TODO write validator, check for path
import os
if env[key] is True:
if searchfunc:
@@ -84,14 +84,14 @@ def _validator(key, val, env, searchfunc):
def PackageVariable(key, help, default, searchfunc=None):
- # NB: searchfunc is currenty undocumented and unsupported
+ # NB: searchfunc is currently undocumented and unsupported
"""
The input parameters describe a 'package list' option, thus they
are returned with the correct converter and validator appended. The
result is usable for input to opts.Add() .
A 'package list' option may either be 'all', 'none' or a list of
- package names (seperated by space).
+ package names (separated by space).
"""
help = '\n '.join(
(help, '( yes | no | /path/to/%s )' % key))
diff --git a/engine/SCons/Variables/PathVariable.py b/engine/SCons/Variables/PathVariable.py
index a7c68a8..081fee5 100644
--- a/engine/SCons/Variables/PathVariable.py
+++ b/engine/SCons/Variables/PathVariable.py
@@ -2,7 +2,7 @@
This file defines an option type for SCons implementing path settings.
-To be used whenever a a user-specified path override should be allowed.
+To be used whenever 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")
@@ -22,7 +22,7 @@ Arguments to PathVariable are:
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
+ and the env is the env to which the Options have been
added.
Usage example:
@@ -46,7 +46,7 @@ Usage example:
"""
#
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -68,7 +68,7 @@ Usage example:
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Variables/PathVariable.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "src/engine/SCons/Variables/PathVariable.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__all__ = ['PathVariable',]
@@ -102,7 +102,7 @@ class _PathVariableClass(object):
os.makedirs(val)
def PathIsFile(self, key, val, env):
- """validator to check if Path is a file"""
+ """Validator to check if Path is a file"""
if not os.path.isfile(val):
if os.path.isdir(val):
m = 'File path for option %s is a directory: %s'
@@ -111,13 +111,12 @@ class _PathVariableClass(object):
raise SCons.Errors.UserError(m % (key, val))
def PathExists(self, key, val, env):
- """validator to check if Path exists"""
+ """Validator to check if Path exists"""
if not os.path.exists(val):
m = 'Path for option %s does not exist: %s'
raise SCons.Errors.UserError(m % (key, val))
def __call__(self, key, help, default, validator=None):
- # NB: searchfunc is currenty undocumented and unsupported
"""
The input parameters describe a 'path list' option, thus they
are returned with the correct converter and validator appended. The
diff --git a/engine/SCons/Variables/__init__.py b/engine/SCons/Variables/__init__.py
index 57447d7..83ec1b2 100644
--- a/engine/SCons/Variables/__init__.py
+++ b/engine/SCons/Variables/__init__.py
@@ -5,7 +5,7 @@ customizable variables to an SCons build.
"""
#
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -26,7 +26,7 @@ customizable variables to an SCons build.
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-__revision__ = "src/engine/SCons/Variables/__init__.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "src/engine/SCons/Variables/__init__.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
import os.path
import sys
@@ -50,12 +50,17 @@ class Variables(object):
Holds all the options, updates the environment with the variables,
and renders the help text.
"""
- def __init__(self, files=[], args={}, is_global=1):
+ def __init__(self, files=None, args=None, is_global=1):
"""
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
"""
+ # initialize arguments
+ if files is None:
+ files = []
+ if args is None:
+ args = {}
self.options = []
self.args = args
if not SCons.Util.is_List(files):