Information-gathering and robustitude.

This commit is contained in:
Jeremy Fincher 2004-08-20 21:17:34 +00:00
parent af994cfcff
commit 535d872cab

View File

@ -98,13 +98,22 @@ def close(registry, filename, annotated=True, helpOnceOnly=False):
try: try:
original = value.value original = value.value
value.value = value._default value.value = value._default
lines.append('# Default value: %s\n' % value) try:
s = str(value)
except Exception, e:
s = 'Error converting to string: %s' % \
utils.exnToString(e)
lines.append('# Default value: %s\n' % s)
finally: finally:
value.value = original value.value = original
lines.append('###\n') lines.append('###\n')
fd.writelines(lines) fd.writelines(lines)
if hasattr(value, 'value'): # This lets us print help for non-valued. if hasattr(value, 'value'): # This lets us print help for non-valued.
fd.write('%s: %s\n' % (name, value)) try:
s = str(value)
except Exception, e:
s = 'Error converting to string: %s' % utils.exnToString(e)
fd.write('%s: %s\n' % (name, s))
fd.close() fd.close()
def isValidRegistryName(name): def isValidRegistryName(name):