Added support for groups alone having help.

This commit is contained in:
Jeremy Fincher 2004-02-07 23:35:42 +00:00
parent 2092fe4134
commit f2f2680c91

View File

@ -85,6 +85,7 @@ def close(registry, filename, annotated=True, helpOnceOnly=False):
first = False
else:
lines.insert(0, '\n')
if hasattr(value, 'value'):
lines.append('#\n')
try:
original = value.value
@ -94,6 +95,7 @@ def close(registry, filename, annotated=True, helpOnceOnly=False):
value.value = original
lines.append('###\n')
fd.writelines(lines)
if hasattr(value, 'value'): # This lets us print help for non-valued.
fd.write('%s: %s\n' % (name, value))
fd.close()
@ -177,7 +179,7 @@ class Group(object):
L = []
for name in self.added:
node = self.children[name]
if hasattr(node, 'value'):
if hasattr(node, 'value') or hasattr(node, 'help'):
if node.__class__ is not self.X:
L.append((node.name, node))
if getChildren: