From 738149c9bfb9965d013d01ef99f9bb1c2819e7e8 Mon Sep 17 00:00:00 2001 From: Luca Falavigna Date: Tue, 15 Jun 2010 14:28:22 +0000 Subject: Imported Upstream version 2.0.0 --- src/engine/SCons/Variables/BoolVariable.py | 6 +-- src/engine/SCons/Variables/BoolVariableTests.py | 2 +- src/engine/SCons/Variables/EnumVariable.py | 22 ++++----- src/engine/SCons/Variables/EnumVariableTests.py | 2 +- src/engine/SCons/Variables/ListVariable.py | 34 ++++++-------- src/engine/SCons/Variables/ListVariableTests.py | 2 +- src/engine/SCons/Variables/PackageVariable.py | 13 ++---- src/engine/SCons/Variables/PackageVariableTests.py | 2 +- src/engine/SCons/Variables/PathVariable.py | 4 +- src/engine/SCons/Variables/PathVariableTests.py | 20 ++++---- src/engine/SCons/Variables/VariablesTests.py | 26 ++++++----- src/engine/SCons/Variables/__init__.py | 53 ++++++++++------------ 12 files changed, 85 insertions(+), 101 deletions(-) (limited to 'src/engine/SCons/Variables') diff --git a/src/engine/SCons/Variables/BoolVariable.py b/src/engine/SCons/Variables/BoolVariable.py index c002fb9..2eeda77 100644 --- a/src/engine/SCons/Variables/BoolVariable.py +++ b/src/engine/SCons/Variables/BoolVariable.py @@ -34,12 +34,10 @@ Usage example: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Variables/BoolVariable.py 4720 2010/03/24 03:14:11 jars" +__revision__ = "src/engine/SCons/Variables/BoolVariable.py 5023 2010/06/14 22:05:46 scons" __all__ = ['BoolVariable',] -import string - import SCons.Errors __true_strings = ('y', 'yes', 'true', 't', '1', 'on' , 'all' ) @@ -57,7 +55,7 @@ def _text2bool(val): This is usable as 'converter' for SCons' Variables. """ - lval = string.lower(val) + lval = val.lower() if lval in __true_strings: return True if lval in __false_strings: return False raise ValueError("Invalid value for boolean option: %s" % val) diff --git a/src/engine/SCons/Variables/BoolVariableTests.py b/src/engine/SCons/Variables/BoolVariableTests.py index b11bf27..c2785ef 100644 --- a/src/engine/SCons/Variables/BoolVariableTests.py +++ b/src/engine/SCons/Variables/BoolVariableTests.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Variables/BoolVariableTests.py 4720 2010/03/24 03:14:11 jars" +__revision__ = "src/engine/SCons/Variables/BoolVariableTests.py 5023 2010/06/14 22:05:46 scons" import sys import unittest diff --git a/src/engine/SCons/Variables/EnumVariable.py b/src/engine/SCons/Variables/EnumVariable.py index 2051bf1..9ae93fb 100644 --- a/src/engine/SCons/Variables/EnumVariable.py +++ b/src/engine/SCons/Variables/EnumVariable.py @@ -37,11 +37,10 @@ Usage example: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Variables/EnumVariable.py 4720 2010/03/24 03:14:11 jars" +__revision__ = "src/engine/SCons/Variables/EnumVariable.py 5023 2010/06/14 22:05:46 scons" __all__ = ['EnumVariable',] -import string import SCons.Errors @@ -80,24 +79,21 @@ def EnumVariable(key, help, default, allowed_values, map={}, ignorecase=0): given 'map'-dictionary (unmapped input values are returned unchanged). """ - help = '%s (%s)' % (help, string.join(allowed_values, '|')) + help = '%s (%s)' % (help, '|'.join(allowed_values)) # define validator if ignorecase >= 1: - validator = lambda key, val, env, vals=allowed_values: \ - _validator(key, string.lower(val), env, vals) + validator = lambda key, val, env: \ + _validator(key, val.lower(), env, allowed_values) else: - validator = lambda key, val, env, vals=allowed_values: \ - _validator(key, val, env, vals) + validator = lambda key, val, env: \ + _validator(key, val, env, allowed_values) # define converter if ignorecase == 2: - converter = lambda val, map=map: \ - string.lower(map.get(string.lower(val), val)) + converter = lambda val: map.get(val.lower(), val).lower() elif ignorecase == 1: - converter = lambda val, map=map: \ - map.get(string.lower(val), val) + converter = lambda val: map.get(val.lower(), val) else: - converter = lambda val, map=map: \ - map.get(val, val) + converter = lambda val: map.get(val, val) return (key, help, default, validator, converter) # Local Variables: diff --git a/src/engine/SCons/Variables/EnumVariableTests.py b/src/engine/SCons/Variables/EnumVariableTests.py index 5262906..5297ed5 100644 --- a/src/engine/SCons/Variables/EnumVariableTests.py +++ b/src/engine/SCons/Variables/EnumVariableTests.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Variables/EnumVariableTests.py 4720 2010/03/24 03:14:11 jars" +__revision__ = "src/engine/SCons/Variables/EnumVariableTests.py 5023 2010/06/14 22:05:46 scons" import sys import unittest diff --git a/src/engine/SCons/Variables/ListVariable.py b/src/engine/SCons/Variables/ListVariable.py index 3ed755f..dbd5f4b 100644 --- a/src/engine/SCons/Variables/ListVariable.py +++ b/src/engine/SCons/Variables/ListVariable.py @@ -45,26 +45,23 @@ Usage example: # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # 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 4720 2010/03/24 03:14:11 jars" +__revision__ = "src/engine/SCons/Variables/ListVariable.py 5023 2010/06/14 22:05:46 scons" # Know Bug: This should behave like a Set-Type, but does not really, # since elements can occur twice. __all__ = ['ListVariable',] -import string -import UserList +import collections import SCons.Util -class _ListVariable(UserList.UserList): +class _ListVariable(collections.UserList): def __init__(self, initlist=[], allowedElems=[]): - UserList.UserList.__init__(self, filter(None, initlist)) - self.allowedElems = allowedElems[:] - self.allowedElems.sort() + collections.UserList.__init__(self, [_f for _f in initlist if _f]) + self.allowedElems = sorted(allowedElems) def __cmp__(self, other): raise NotImplementedError @@ -85,7 +82,7 @@ class _ListVariable(UserList.UserList): if self.data == self.allowedElems: return 'all' else: - return string.join(self, ',') + return ','.join(self) def prepare_to_store(self): return self.__str__() @@ -97,12 +94,12 @@ def _converter(val, allowedElems, mapdict): elif val == 'all': val = allowedElems else: - val = filter(None, string.split(val, ',')) - val = map(lambda v, m=mapdict: m.get(v, v), val) - notAllowed = filter(lambda v, aE=allowedElems: not v in aE, val) + val = [_f for _f in val.split(',') if _f] + val = [mapdict.get(v, v) for v in val] + notAllowed = [v for v in val if not v in allowedElems] if notAllowed: raise ValueError("Invalid value(s) for option: %s" % - string.join(notAllowed, ',')) + ','.join(notAllowed)) return _ListVariable(val, allowedElems) @@ -122,15 +119,14 @@ def ListVariable(key, help, default, names, map={}): A 'package list' option may either be 'all', 'none' or a list of package names (separated by space). """ - names_str = 'allowed names: %s' % string.join(names, ' ') + names_str = 'allowed names: %s' % ' '.join(names) if SCons.Util.is_List(default): - default = string.join(default, ',') - help = string.join( - (help, '(all|none|comma-separated list of names)', names_str), - '\n ') + default = ','.join(default) + help = '\n '.join( + (help, '(all|none|comma-separated list of names)', names_str)) return (key, help, default, None, #_validator, - lambda val, elems=names, m=map: _converter(val, elems, m)) + lambda val: _converter(val, names, map)) # Local Variables: # tab-width:4 diff --git a/src/engine/SCons/Variables/ListVariableTests.py b/src/engine/SCons/Variables/ListVariableTests.py index 3d96cd0..3096e7e 100644 --- a/src/engine/SCons/Variables/ListVariableTests.py +++ b/src/engine/SCons/Variables/ListVariableTests.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Variables/ListVariableTests.py 4720 2010/03/24 03:14:11 jars" +__revision__ = "src/engine/SCons/Variables/ListVariableTests.py 5023 2010/06/14 22:05:46 scons" import copy import sys diff --git a/src/engine/SCons/Variables/PackageVariable.py b/src/engine/SCons/Variables/PackageVariable.py index 362f67e..d9ce2a6 100644 --- a/src/engine/SCons/Variables/PackageVariable.py +++ b/src/engine/SCons/Variables/PackageVariable.py @@ -50,12 +50,10 @@ Usage example: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Variables/PackageVariable.py 4720 2010/03/24 03:14:11 jars" +__revision__ = "src/engine/SCons/Variables/PackageVariable.py 5023 2010/06/14 22:05:46 scons" __all__ = ['PackageVariable',] -import string - import SCons.Errors __enable_strings = ('1', 'yes', 'true', 'on', 'enable', 'search') @@ -64,7 +62,7 @@ __disable_strings = ('0', 'no', 'false', 'off', 'disable') def _converter(val): """ """ - lval = string.lower(val) + lval = val.lower() if lval in __enable_strings: return True if lval in __disable_strings: return False #raise ValueError("Invalid value for boolean option: %s" % val) @@ -95,11 +93,10 @@ def PackageVariable(key, help, default, searchfunc=None): A 'package list' option may either be 'all', 'none' or a list of package names (seperated by space). """ - help = string.join( - (help, '( yes | no | /path/to/%s )' % key), - '\n ') + help = '\n '.join( + (help, '( yes | no | /path/to/%s )' % key)) return (key, help, default, - lambda k, v, e, f=searchfunc: _validator(k,v,e,f), + lambda k, v, e: _validator(k,v,e,searchfunc), _converter) # Local Variables: diff --git a/src/engine/SCons/Variables/PackageVariableTests.py b/src/engine/SCons/Variables/PackageVariableTests.py index 4a5b0ee..097ffc6 100644 --- a/src/engine/SCons/Variables/PackageVariableTests.py +++ b/src/engine/SCons/Variables/PackageVariableTests.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Variables/PackageVariableTests.py 4720 2010/03/24 03:14:11 jars" +__revision__ = "src/engine/SCons/Variables/PackageVariableTests.py 5023 2010/06/14 22:05:46 scons" import sys import unittest diff --git a/src/engine/SCons/Variables/PathVariable.py b/src/engine/SCons/Variables/PathVariable.py index 4af9fc3..445cfe2 100644 --- a/src/engine/SCons/Variables/PathVariable.py +++ b/src/engine/SCons/Variables/PathVariable.py @@ -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 4720 2010/03/24 03:14:11 jars" +__revision__ = "src/engine/SCons/Variables/PathVariable.py 5023 2010/06/14 22:05:46 scons" __all__ = ['PathVariable',] @@ -77,7 +77,7 @@ import os.path import SCons.Errors -class _PathVariableClass: +class _PathVariableClass(object): def PathAccept(self, key, val, env): """Accepts any path, no checking done.""" diff --git a/src/engine/SCons/Variables/PathVariableTests.py b/src/engine/SCons/Variables/PathVariableTests.py index 93f2b17..c55a6ed 100644 --- a/src/engine/SCons/Variables/PathVariableTests.py +++ b/src/engine/SCons/Variables/PathVariableTests.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Variables/PathVariableTests.py 4720 2010/03/24 03:14:11 jars" +__revision__ = "src/engine/SCons/Variables/PathVariableTests.py 5023 2010/06/14 22:05:46 scons" import os.path import sys @@ -68,7 +68,7 @@ class PathVariableTestCase(unittest.TestCase): except SCons.Errors.UserError, e: assert str(e) == 'Path for option X does not exist: %s' % dne, e except: - raise "did not catch expected UserError" + raise Exception("did not catch expected UserError") def test_PathIsDir(self): """Test the PathIsDir validator""" @@ -92,7 +92,7 @@ class PathVariableTestCase(unittest.TestCase): except SCons.Errors.UserError, e: assert str(e) == 'Directory path for option X is a file: %s' % f, e except: - raise "did not catch expected UserError" + raise Exception("did not catch expected UserError") dne = test.workpath('does_not_exist') try: @@ -100,7 +100,7 @@ class PathVariableTestCase(unittest.TestCase): except SCons.Errors.UserError, e: assert str(e) == 'Directory path for option X does not exist: %s' % dne, e except: - raise "did not catch expected UserError" + raise Exception("did not catch expected UserError") def test_PathIsDirCreate(self): """Test the PathIsDirCreate validator""" @@ -125,7 +125,7 @@ class PathVariableTestCase(unittest.TestCase): except SCons.Errors.UserError, e: assert str(e) == 'Path for option X is a file, not a directory: %s' % f, e except: - raise "did not catch expected UserError" + raise Exception("did not catch expected UserError") def test_PathIsFile(self): """Test the PathIsFile validator""" @@ -149,7 +149,7 @@ class PathVariableTestCase(unittest.TestCase): except SCons.Errors.UserError, e: assert str(e) == 'File path for option X does not exist: %s' % d, e except: - raise "did not catch expected UserError" + raise Exception("did not catch expected UserError") dne = test.workpath('does_not_exist') try: @@ -157,7 +157,7 @@ class PathVariableTestCase(unittest.TestCase): except SCons.Errors.UserError, e: assert str(e) == 'File path for option X does not exist: %s' % dne, e except: - raise "did not catch expected UserError" + raise Exception("did not catch expected UserError") def test_PathAccept(self): """Test the PathAccept validator""" @@ -202,10 +202,10 @@ class PathVariableTestCase(unittest.TestCase): expect = 'Path for option X does not exist: %s' % dne assert str(e) == expect, e else: - raise "did not catch expected UserError" + raise Exception("did not catch expected UserError") def my_validator(key, val, env): - raise Exception, "my_validator() got called for %s, %s!" % (key, val) + raise Exception("my_validator() got called for %s, %s!" % (key, val)) opts = SCons.Variables.Variables() opts.Add(SCons.Variables.PathVariable('test2', @@ -220,7 +220,7 @@ class PathVariableTestCase(unittest.TestCase): except Exception, e: assert str(e) == 'my_validator() got called for Y, value!', e else: - raise "did not catch expected exception from my_validator()" + raise Exception("did not catch expected exception from my_validator()") diff --git a/src/engine/SCons/Variables/VariablesTests.py b/src/engine/SCons/Variables/VariablesTests.py index 617cf8f..7ecbc0d 100644 --- a/src/engine/SCons/Variables/VariablesTests.py +++ b/src/engine/SCons/Variables/VariablesTests.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Variables/VariablesTests.py 4720 2010/03/24 03:14:11 jars" +__revision__ = "src/engine/SCons/Variables/VariablesTests.py 5023 2010/06/14 22:05:46 scons" import sys import unittest @@ -32,7 +32,7 @@ import SCons.Subst import SCons.Warnings -class Environment: +class Environment(object): def __init__(self): self.dict = {} def subst(self, x): @@ -41,8 +41,10 @@ class Environment: self.dict[key] = value def __getitem__(self, key): return self.dict[key] + def __contains__(self, key): + return self.dict.__contains__(key) def has_key(self, key): - return self.dict.has_key(key) + return key in self.dict def check(key, value, env): @@ -68,7 +70,7 @@ class VariablesTestCase(unittest.TestCase): "42", check, lambda x: int(x) + 12) - keys = opts.keys() + keys = list(opts.keys()) assert keys == ['VAR1', 'VAR2'], keys def test_Add(self): @@ -253,7 +255,7 @@ class VariablesTestCase(unittest.TestCase): env = Environment() opts.Update(env, {}) - assert not env.has_key('ANSWER') + assert 'ANSWER' not in env # Test that a default value of None is all right. test = TestSCons.TestSCons() @@ -267,7 +269,7 @@ class VariablesTestCase(unittest.TestCase): env = Environment() opts.Update(env, {}) - assert not env.has_key('ANSWER') + assert 'ANSWER' not in env def test_args(self): """Test updating an Environment with arguments overridden""" @@ -378,7 +380,7 @@ class VariablesTestCase(unittest.TestCase): 'OPT_BOOL_2' : 2}) # Test against some old bugs - class Foo: + class Foo(object): def __init__(self, x): self.x = x def __str__(self): @@ -527,12 +529,12 @@ B 42 54 b - alpha test ['B'] env = Environment() opts.Update(env, {'ANSWER' : 'answer'}) - assert env.has_key('ANSWER') + assert 'ANSWER' in env env = Environment() opts.Update(env, {'ANSWERALIAS' : 'answer'}) - assert env.has_key('ANSWER') and not env.has_key('ANSWERALIAS') + assert 'ANSWER' in env and 'ANSWERALIAS' not in env # test alias as a list opts = SCons.Variables.Variables() @@ -545,12 +547,12 @@ B 42 54 b - alpha test ['B'] env = Environment() opts.Update(env, {'ANSWER' : 'answer'}) - assert env.has_key('ANSWER') + assert 'ANSWER' in env env = Environment() opts.Update(env, {'ANSWERALIAS' : 'answer'}) - assert env.has_key('ANSWER') and not env.has_key('ANSWERALIAS') + assert 'ANSWER' in env and 'ANSWERALIAS' not in env @@ -652,7 +654,7 @@ if __name__ == "__main__": UnknownVariablesTestCase ] for tclass in tclasses: names = unittest.getTestCaseNames(tclass, 'test_') - suite.addTests(map(tclass, names)) + suite.addTests(list(map(tclass, names))) if not unittest.TextTestRunner().run(suite).wasSuccessful(): sys.exit(1) diff --git a/src/engine/SCons/Variables/__init__.py b/src/engine/SCons/Variables/__init__.py index 8840b97..d8562b0 100644 --- a/src/engine/SCons/Variables/__init__.py +++ b/src/engine/SCons/Variables/__init__.py @@ -25,12 +25,10 @@ customizable variables to an SCons build. # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # 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 4720 2010/03/24 03:14:11 jars" +__revision__ = "src/engine/SCons/Variables/__init__.py 5023 2010/06/14 22:05:46 scons" import os.path -import string import sys import SCons.Environment @@ -45,7 +43,7 @@ from PackageVariable import PackageVariable # naja from PathVariable import PathVariable # okay -class Variables: +class Variables(object): instance=None """ @@ -76,7 +74,7 @@ class Variables: Variables.instance=self def _do_add(self, key, help="", default=None, validator=None, converter=None): - class Variable: + class Variable(object): pass option = Variable() @@ -84,11 +82,11 @@ class Variables: # if we get a list or a tuple, we take the first element as the # option key and store the remaining in aliases. if SCons.Util.is_List(key) or SCons.Util.is_Tuple(key): - option.key = key[0] - option.aliases = key[1:] + option.key = key[0] + option.aliases = key[1:] else: - option.key = key - option.aliases = [ key ] + option.key = key + option.aliases = [ key ] option.help = help option.default = default option.validator = validator @@ -99,16 +97,14 @@ class Variables: # options might be added after the 'unknown' dict has been set up, # so we remove the key and all its aliases from that dict for alias in list(option.aliases) + [ option.key ]: - # TODO(1.5) - #if alias in self.unknown: - if alias in self.unknown.keys(): - del self.unknown[alias] + if alias in self.unknown: + del self.unknown[alias] def keys(self): """ Returns the keywords for the options """ - return map(lambda o: o.key, self.options) + return [o.key for o in self.options] def Add(self, key, help="", default=None, validator=None, converter=None, **kw): """ @@ -123,13 +119,13 @@ class Variables: putting it in the environment. """ - if SCons.Util.is_List(key) or type(key) == type(()): - apply(self._do_add, key) + if SCons.Util.is_List(key) or isinstance(key, tuple): + self._do_add(*key) return if not SCons.Util.is_String(key) or \ - not SCons.Environment.is_valid_construction_var(key): - raise SCons.Errors.UserError, "Illegal Variables.Add() key `%s'" % str(key) + not SCons.Environment.is_valid_construction_var(key): + raise SCons.Errors.UserError("Illegal Variables.Add() key `%s'" % str(key)) self._do_add(key, help, default, validator, converter) @@ -149,7 +145,7 @@ class Variables: ) """ for o in optlist: - apply(self._do_add, o) + self._do_add(*o) def Update(self, env, args=None): @@ -203,7 +199,7 @@ class Variables: # Call the convert functions: for option in self.options: - if option.converter and values.has_key(option.key): + if option.converter and option.key in values: value = env.subst('${%s}'%option.key) try: try: @@ -211,12 +207,12 @@ class Variables: except TypeError: env[option.key] = option.converter(value, env) except ValueError, x: - raise SCons.Errors.UserError, 'Error converting option: %s\n%s'%(option.key, x) + raise SCons.Errors.UserError('Error converting option: %s\n%s'%(option.key, x)) # Finally validate the values: for option in self.options: - if option.validator and values.has_key(option.key): + if option.validator and option.key in values: option.validator(option.key, env.subst('${%s}'%option.key), env) def UnknownVariables(self): @@ -273,7 +269,7 @@ class Variables: fh.close() except IOError, x: - raise SCons.Errors.UserError, 'Error writing options to file: %s\n%s' % (filename, x) + raise SCons.Errors.UserError('Error writing options to file: %s\n%s' % (filename, x)) def GenerateHelpText(self, env, sort=None): """ @@ -284,27 +280,26 @@ class Variables: """ if sort: - options = self.options[:] - options.sort(lambda x,y,func=sort: func(x.key,y.key)) + options = sorted(self.options, key=lambda x: x.key) else: options = self.options def format(opt, self=self, env=env): - if env.has_key(opt.key): + if opt.key in env: actual = env.subst('${%s}' % opt.key) else: actual = None return self.FormatVariableHelpText(env, opt.key, opt.help, opt.default, actual, opt.aliases) - lines = filter(None, map(format, options)) + lines = [_f for _f in map(format, options) if _f] - return string.join(lines, '') + return ''.join(lines) format = '\n%s: %s\n default: %s\n actual: %s\n' format_ = '\n%s: %s\n default: %s\n actual: %s\n aliases: %s\n' def FormatVariableHelpText(self, env, key, help, default, actual, aliases=[]): # Don't display the key name itself as an alias. - aliases = filter(lambda a, k=key: a != k, aliases) + aliases = [a for a in aliases if a != key] if len(aliases)==0: return self.format % (key, help, default, actual) else: -- cgit v1.2.3