Added user defined descriptor class derived from the base found in
tconfpy.
1 parent 8a6eed7 commit 4cdae7d5638c079d3d53817d8773fe95bbcf0c7a
@tundra tundra authored on 20 Mar 2004
Showing 1 changed file
View
28
test-tc.py
#!/usr/bin/env python
# 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
 
symtbl[sym] = d
 
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 ..."
sys.exit(1)
 
if sys.argv[1].lower() == "debug":
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)