mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-17 06:00:42 +01:00
Information-gathering and robustitude.
This commit is contained in:
parent
af994cfcff
commit
535d872cab
@ -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):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user