Changed the sorting function.

This commit is contained in:
Jeremy Fincher 2004-01-14 14:18:56 +00:00
parent 3319e2562d
commit 0ddb356c0b

View File

@ -196,12 +196,12 @@ class Group(object):
def getValues(self, askChildren=False): def getValues(self, askChildren=False):
L = [] L = []
items = self.values.items() items = self.values.items()
items.sort() utils.sortBy(lambda (k, _): (k.lower(), len(k), k), items)
for (name, value) in items: for (name, value) in items:
L.append(('%s.%s' % (self.getName(), name), str(value))) L.append(('%s.%s' % (self.getName(), name), str(value)))
if askChildren: if askChildren:
items = self.children.items() items = self.children.items()
items.sort() utils.sortBy(lambda (k, _): (k.lower(), len(k), k), items)
for (_, child) in items: for (_, child) in items:
L.extend(child.getValues(askChildren)) L.extend(child.getValues(askChildren))
return L return L