Remove dead code from Group that belongs in Value.

This commit is contained in:
Valentin Lorentz 2019-12-09 21:27:09 +01:00
parent 83114e5fbd
commit a86df1fc35

View File

@ -199,7 +199,7 @@ class Group(object):
"""A group; it doesn't hold a value unless handled by a subclass.""" """A group; it doesn't hold a value unless handled by a subclass."""
__slots__ = ('_help', '_name', '_added', '_children', '_lastModified', __slots__ = ('_help', '_name', '_added', '_children', '_lastModified',
'_private', '_supplyDefault', '_orderAlphabetically', '_wasSet') '_private', '_supplyDefault', '_orderAlphabetically', '_wasSet')
def __init__(self, help='', supplyDefault=False, def __init__(self, help='',
orderAlphabetically=True, private=False): orderAlphabetically=True, private=False):
self._help = utils.str.normalizeWhitespace(help) self._help = utils.str.normalizeWhitespace(help)
self._name = 'unset' self._name = 'unset'
@ -207,7 +207,7 @@ class Group(object):
self._children = utils.InsensitivePreservingDict() self._children = utils.InsensitivePreservingDict()
self._lastModified = 0 self._lastModified = 0
self._private = private self._private = private
self._supplyDefault = supplyDefault self._supplyDefault = False # It should only be true for Value
self._orderAlphabetically = orderAlphabetically self._orderAlphabetically = orderAlphabetically
self._wasSet = True self._wasSet = True
@ -219,13 +219,8 @@ class Group(object):
raise NonExistentRegistryEntry(s) raise NonExistentRegistryEntry(s)
def _makeChild(self, attr, s): def _makeChild(self, attr, s):
v = self.__class__(self._default, self._help) raise NotImplementedError(
v.set(s) 'Group does not implement _makeChild; only Value does.')
v._wasSet = False
v._supplyDefault = False
v._help = '' # Clear this so it doesn't print a bazillion times.
self.register(attr, v)
return v
def __hasattr__(self, attr): def __hasattr__(self, attr):
return attr in self._children return attr in self._children