mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 11:42:52 +01:00
Some slight updates.
This commit is contained in:
parent
363fa7e6ea
commit
3bac853c61
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user