diff --git a/test-tc.py b/test-tc.py index 29845ae..3435e88 100755 --- a/test-tc.py +++ b/test-tc.py @@ -2,7 +2,7 @@ # Copyright (c) 2003-2004 TundraWare Inc. All Rights Reserved. PROGNAME = "tconfpy Test Driver" -RCSID = "$Id: test-tc.py,v 1.111 2004/03/20 00:03:54 tundra Exp $" +RCSID = "$Id: test-tc.py,v 1.112 2004/03/20 00:40:01 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -18,6 +18,23 @@ import tconfpy import sys + +########## +# Format and return contents of a variable descriptor +########## + + +def dumpdescript(val, d): + + retval = str(val) + " " * (15 - len(val)) + + for v, p in ((d.Value, 10), (d.Writeable, 7), (d.Type, 17), (d.Default, 10), (d.LegalVals, 10), (d.Min, 10), (d.Max, 10)): + retval += str(v) + (p - len(str(v))) * ' ' + + return retval + +# End of 'dumpdescript()' + ########## # Routine to dump returned values ########## @@ -36,11 +53,7 @@ for val in items: if isdict: - d = data[val] - f = "'%s'" - if d.Type != type(f): - f = "%s" - print val + (15-len(val)) * " ", d.Value, " ", d.Writeable, d.Type, f % d.Default, d.LegalVals, d.Min, d.Max + print dumpdescript(val, data[val]) else: print val