diff --git a/tconfpy.py b/tconfpy.py index 2e13be1..b8d82a7 100755 --- a/tconfpy.py +++ b/tconfpy.py @@ -6,7 +6,7 @@ # Program Information PROGNAME = "tconfpy" -RCSID = "$Id: tconfpy.py,v 1.106 2004/03/12 08:32:35 tundra Exp $" +RCSID = "$Id: tconfpy.py,v 1.107 2004/03/12 09:10:02 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -59,10 +59,11 @@ # Constants ########### -# General Constants +# Formatting Constants -MSGPOS = 10 # Where to start message output - +MSGPOS = 10 # Where to start message output +FILENUM = "[File: %s Line: %s]" # Display filename and linenum +PTR = " ---> " # Textual pointer for debug output # Reserved Symbols @@ -127,16 +128,16 @@ ########## dDEBUG = "DEBUG" -dLINEIGNORE = "%s Line %d Ignored/Not Included" -dNUMLINES = "Processing '%s' Resulted In %d Total Lines Parsed" -dPARSEDLINE = "%s Line %d Parses To: %s" +dLINEIGNORE = FILENUM + " Line Ignored/Not Included" + PTR + "%s\n" +dNUMLINES = "Processing File '%s' Resulted In %d Total Lines Parsed" +dPARSEDLINE = FILENUM + " %s" + PTR + "%s\n" ########### # Error Messages ########### eCONFOPEN = "Cannot Open The File '%s'" -eENDIFEXTRA = "%s Line %d: " + ENDIF + " Without Matching Condition" +eENDIFEXTRA = FILENUM + " " + ENDIF + " Without Matching Condition" eERROR = "ERROR" @@ -149,7 +150,7 @@ # Warning Messages ########### -wENDIFBAD = "%s Line %d: Text After " + ENDIF + " Ignored" +wENDIFBAD = FILENUM + " Text After " + ENDIF + " Ignored" wWARNING = "WARNING" @@ -213,11 +214,12 @@ def mkmsg(msg, msgtype=""): if msgtype: - msgtype += ":" + msgtype += ">" pad = " " * (MSGPOS - len(msgtype)) - return "%s - %s%s%s" % (PROGINFO, msgtype, pad, msg) + return "%s %s%s%s" % (PROGINFO, msgtype, pad, msg) + # End of 'mkmsg()' @@ -329,6 +331,7 @@ global CondStack, MsgList, SymTable + orig = line line = ConditionLine(line) ########## @@ -358,10 +361,9 @@ # If we are in a False conditional block, this line # is ignored. - print linenum, CondStack, line if not CondStack[-1]: if DEBUG: - DebugMsg(dLINEIGNORE %(cfgfile, linenum)) + DebugMsg(dLINEIGNORE %(cfgfile, linenum, orig)) return # Process .include statements @@ -382,6 +384,6 @@ ########## if DEBUG: - DebugMsg(dPARSEDLINE %(cfgfile, linenum, line)) + DebugMsg(dPARSEDLINE %(cfgfile, linenum, orig, line)) # End of 'ParseLine'