From a86df1fc354543a05bf2cd161002c24f1b09eb90 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Mon, 9 Dec 2019 21:27:09 +0100 Subject: [PATCH] Remove dead code from Group that belongs in Value. --- src/registry.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/registry.py b/src/registry.py index 8226fb7a2..1753aaf4b 100644 --- a/src/registry.py +++ b/src/registry.py @@ -199,7 +199,7 @@ class Group(object): """A group; it doesn't hold a value unless handled by a subclass.""" __slots__ = ('_help', '_name', '_added', '_children', '_lastModified', '_private', '_supplyDefault', '_orderAlphabetically', '_wasSet') - def __init__(self, help='', supplyDefault=False, + def __init__(self, help='', orderAlphabetically=True, private=False): self._help = utils.str.normalizeWhitespace(help) self._name = 'unset' @@ -207,7 +207,7 @@ class Group(object): self._children = utils.InsensitivePreservingDict() self._lastModified = 0 self._private = private - self._supplyDefault = supplyDefault + self._supplyDefault = False # It should only be true for Value self._orderAlphabetically = orderAlphabetically self._wasSet = True @@ -219,13 +219,8 @@ class Group(object): raise NonExistentRegistryEntry(s) def _makeChild(self, attr, s): - v = self.__class__(self._default, self._help) - v.set(s) - v._wasSet = False - v._supplyDefault = False - v._help = '' # Clear this so it doesn't print a bazillion times. - self.register(attr, v) - return v + raise NotImplementedError( + 'Group does not implement _makeChild; only Value does.') def __hasattr__(self, attr): return attr in self._children