mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 19:52:54 +01:00
Renamed to _children.
This commit is contained in:
parent
a9ab89664c
commit
1c84dd676b
@ -98,7 +98,7 @@ class Config(callbacks.Privmsg):
|
|||||||
group = getWrapper(name)
|
group = getWrapper(name)
|
||||||
if groups:
|
if groups:
|
||||||
L = []
|
L = []
|
||||||
for (vname, v) in group.children.iteritems():
|
for (vname, v) in group._children.iteritems():
|
||||||
if v.added:
|
if v.added:
|
||||||
L.append(vname)
|
L.append(vname)
|
||||||
utils.sortBy(str.lower, L)
|
utils.sortBy(str.lower, L)
|
||||||
|
@ -136,7 +136,7 @@ class Group(object):
|
|||||||
def __init__(self, supplyDefault=False):
|
def __init__(self, supplyDefault=False):
|
||||||
self._name = 'unset'
|
self._name = 'unset'
|
||||||
self.added = []
|
self.added = []
|
||||||
self.children = utils.InsensitivePreservingDict()
|
self._children = utils.InsensitivePreservingDict()
|
||||||
self._lastModified = 0
|
self._lastModified = 0
|
||||||
self.supplyDefault = supplyDefault
|
self.supplyDefault = supplyDefault
|
||||||
OriginalClass = self.__class__
|
OriginalClass = self.__class__
|
||||||
@ -168,8 +168,8 @@ class Group(object):
|
|||||||
return v
|
return v
|
||||||
|
|
||||||
def __getattr__(self, attr):
|
def __getattr__(self, attr):
|
||||||
if attr in self.children:
|
if attr in self._children:
|
||||||
return self.children[attr]
|
return self._children[attr]
|
||||||
elif self.supplyDefault:
|
elif self.supplyDefault:
|
||||||
return self.__makeChild(attr, str(self))
|
return self.__makeChild(attr, str(self))
|
||||||
else:
|
else:
|
||||||
@ -201,8 +201,8 @@ class Group(object):
|
|||||||
raise InvalidRegistryName, name
|
raise InvalidRegistryName, name
|
||||||
if node is None:
|
if node is None:
|
||||||
node = Group()
|
node = Group()
|
||||||
if name not in self.children: # XXX Is this right?
|
if name not in self._children: # XXX Is this right?
|
||||||
self.children[name] = node
|
self._children[name] = node
|
||||||
self.added.append(name)
|
self.added.append(name)
|
||||||
names = split(self._name)
|
names = split(self._name)
|
||||||
names.append(name)
|
names.append(name)
|
||||||
@ -212,8 +212,8 @@ class Group(object):
|
|||||||
|
|
||||||
def unregister(self, name):
|
def unregister(self, name):
|
||||||
try:
|
try:
|
||||||
node = self.children[name]
|
node = self._children[name]
|
||||||
del self.children[name]
|
del self._children[name]
|
||||||
self.added.remove(name)
|
self.added.remove(name)
|
||||||
if node._name in _cache:
|
if node._name in _cache:
|
||||||
del _cache[node._name]
|
del _cache[node._name]
|
||||||
@ -228,7 +228,7 @@ class Group(object):
|
|||||||
def getValues(self, getChildren=False, fullNames=True):
|
def getValues(self, getChildren=False, fullNames=True):
|
||||||
L = []
|
L = []
|
||||||
for name in self.added:
|
for name in self.added:
|
||||||
node = self.children[name]
|
node = self._children[name]
|
||||||
if hasattr(node, 'value') or hasattr(node, 'help'):
|
if hasattr(node, 'value') or hasattr(node, 'help'):
|
||||||
if node.__class__ is not self.X:
|
if node.__class__ is not self.X:
|
||||||
L.append((node._name, node))
|
L.append((node._name, node))
|
||||||
@ -279,7 +279,7 @@ class Value(Group):
|
|||||||
self._lastModified = time.time()
|
self._lastModified = time.time()
|
||||||
self.value = v
|
self.value = v
|
||||||
if self.supplyDefault:
|
if self.supplyDefault:
|
||||||
for (name, v) in self.children.items():
|
for (name, v) in self._children.items():
|
||||||
if v.__class__ is self.X:
|
if v.__class__ is self.X:
|
||||||
self.unregister(name)
|
self.unregister(name)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user