| | #!/usr/bin/env python |
---|
| | # tconfpy.py |
---|
| | # Copyright (c) 2003-2004 TundraWare Inc. All Rights Reserved. |
---|
| | # Copyright (c) 2003-2005 TundraWare Inc. All Rights Reserved. |
---|
| | # For Updates See: http://www.tundraware.com/Software/tconfpy |
---|
| | |
---|
| | # Program Information |
---|
| | |
---|
| | PROGNAME = "tconfpy" |
---|
| | RCSID = "$Id: tconfpy.py,v 1.185 2004/05/02 08:06:07 tundra Exp $" |
---|
| | RCSID = "$Id: tconfpy.py,v 1.186 2005/01/13 10:36:24 tundra Exp $" |
---|
| | VERSION = RCSID.split()[2] |
---|
| | |
---|
| | # Copyright Information |
---|
| | |
---|
| | CPRT = chr(169) |
---|
| | DATE = "2003-2004" |
---|
| | DATE = "2003-2005" |
---|
| | OWNER = "TundraWare Inc." |
---|
| | RIGHTS = "All Rights Reserved" |
---|
| | COPYRIGHT = "Copyright %s %s %s, %s." % (CPRT, DATE, OWNER, RIGHTS) |
---|
| | PROGINFO = PROGNAME + " " + VERSION |
---|
| |
---|
| | def mkmsg(msg, msgtype): |
---|
| | |
---|
| | pad = " " * (MAXMSG - len(msgtype) + 2) |
---|
| | |
---|
| | return "%s %s%s%s" % (PROGINFO, MSGPROMPT % msgtype, pad, msg) |
---|
| | return "%s %s%s%s" % (mkmsg.proginfo, MSGPROMPT % msgtype, pad, msg) |
---|
| | |
---|
| | |
---|
| | # End of 'mkmsg()' |
---|
| | |
---|
| |
---|
| | # Public API To Module # |
---|
| | #----------------------------------------------------------# |
---|
| | |
---|
| | def ParseConfig(cfgfile, |
---|
| | CallingProgram=PROGINFO, |
---|
| | InitialSymTable={}, |
---|
| | AllowNewVars=True, |
---|
| | Templates={}, |
---|
| | TemplatesOnly=False, |
---|
| |
---|
| | |
---|
| | CondStack = [["", True],] # Always has one entry as a sentinel |
---|
| | TotalLines = 0 |
---|
| | |
---|
| | # Set the name of the calling program for output messages |
---|
| | |
---|
| | mkmsg.proginfo = CallingProgram |
---|
| | |
---|
| | |
---|
| | # Setup container to return parsing results |
---|
| | |
---|
| | retobj = RetObj() |
---|
| | |
---|
| |
---|
| | |