Some slight updates.

This commit is contained in:
Jeremy Fincher 2004-01-27 11:25:36 +00:00
parent 363fa7e6ea
commit 3bac853c61

View File

@ -230,6 +230,9 @@ class SeparatedListOf(Value):
L[i] = v()
self.setValue(L)
def setValue(self, v):
Value.setValue(self, list(v))
def __str__(self):
return self.joiner(self.value)
@ -309,6 +312,8 @@ class Group(object):
def getValues(self, getChildren=False, fullNames=True):
L = []
items = self.values.items()
# If getChildren=True, the group will insert itself into its getValues.
if not getChildren:
for (name, child) in self.children.items():
if hasattr(child, 'value'):
items.append((name, child))
@ -346,6 +351,12 @@ class GroupWithValue(Group):
def __str__(self):
return str(self.value)
def getValues(self, getChildren=False, fullNames=True):
L = Group.getValues(self, getChildren, fullNames)
if getChildren:
L.insert(0, (self.getName(), self))
return L
class GroupWithDefault(GroupWithValue):
def __init__(self, value):
@ -362,6 +373,7 @@ class GroupWithDefault(GroupWithValue):
GroupWithValue.__init__(self, value)
def __makeChild(self, attr, s):
#print '***', attr, ':', repr(s)
v = copy.copy(self.value)
v.set(s)
v.__class__ = self.X