diff --git a/test-tc.py b/test-tc.py index 2fb0baf..985dd65 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.114 2004/03/20 00:50:12 tundra Exp $" +RCSID = "$Id: test-tc.py,v 1.115 2004/03/20 10:48:03 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -114,6 +114,28 @@ symtbl["fox"].Writeable = False + + +# Here's a way to inherit the base symbol definition from +# the module and then derive a new object type for your +# own convenience + +class mycmplx(tconfpy.VarDescriptor): + def __init__(self): + tconfpy.VarDescriptor.__init__(self) + self.Value = 2-2j + self.Default = 39-4j + self.Type = tconfpy.TYPE_COMPLEX + +# Instantiate one of these +mc = mycmplx() + +# And stuff it in the symbol table +symtbl["MyComplex"] = mc + + +# Make sure we got legit arguments + if len(sys.argv) < 2: print BANNER print "Usage: test-tc.py [debug] file file ..." @@ -123,6 +145,10 @@ files = 2 DEBUG = True + +# Process all the requested configuration files, +# dumping the what tconfpy returns for each one. + for fn in sys.argv[files:]: retval = tconfpy.ParseConfig(fn, symtbl, debug=DEBUG)