Changed line parser logic to provide debug indication that
a line parsed to blank and was ignored.
1 parent 72a6af3 commit f2bc620ad6b8ccf3490403c21c1ee80e937d6ad7
@tundra tundra authored on 12 Mar 2004
Showing 1 changed file
View
25
tconfpy.py
 
# Program Information
 
PROGNAME = "tconfpy"
RCSID = "$Id: tconfpy.py,v 1.109 2004/03/12 10:14:02 tundra Exp $"
RCSID = "$Id: tconfpy.py,v 1.110 2004/03/13 00:19:04 tundra Exp $"
VERSION = RCSID.split()[2]
 
# Copyright Information
 
# Debug Messages
##########
 
dDEBUG = "DEBUG"
dLINEIGNORE = FILENUM + " Line Ignored/Not Included" + PTR + "%s\n"
 
dBLANKLINE = "(Parsed To Blank Line - Ignored)"
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"
dPARSEDLINE = FILENUM + " '%s'" + PTR + "'%s'\n"
 
###########
# Error Messages
###########
 
eERROR = "ERROR"
 
eCONFOPEN = "Cannot Open The File '%s'"
eENDIFEXTRA = FILENUM + " " + ENDIF + " Without Matching Condition"
eERROR = "ERROR"
 
 
###########
# Prompts
###########
# Warning Messages
###########
 
wWARNING = "WARNING"
 
wENDIFBAD = FILENUM + " Text After " + ENDIF + " Ignored"
wWARNING = "WARNING"
 
 
#--------------------------- Code Begins Here ---------------------------------#
 
#####
 
if not CondStack[-1]:
if DEBUG:
DebugMsg(dLINEIGNORE %(cfgfile, linenum, orig))
DebugMsg(dLINEIGNORE % (cfgfile, linenum, orig))
return
 
#####
# .include Processing
else:
for ref in Reserved.keys():
line = line.replace("%s%s%s" % (DELIML, ref, DELIMR), Reserved[ref])
 
 
##########
# End Of Line Parser
##########
 
if DEBUG:
 
# Note blank lines for debug purposes
if not line:
line = dBLANKLINE
 
DebugMsg(dPARSEDLINE %(cfgfile, linenum, orig, line))
# End of 'ParseLine'