diff --git a/tconfpy.py b/tconfpy.py index 45f1782..2f4742e 100755 --- a/tconfpy.py +++ b/tconfpy.py @@ -6,7 +6,7 @@ # Program Information PROGNAME = "tconfpy" -RCSID = "$Id: tconfpy.py,v 1.129 2004/03/21 14:25:20 tundra Exp $" +RCSID = "$Id: tconfpy.py,v 1.130 2004/03/22 17:56:10 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -244,8 +244,10 @@ # Messages -Messages["wENDLITMISS"] = FILENUM + "Missing '%s' Statement. All lines treated literally to end-of-file." % ENDLITERAL -Messages["wEXTRATEXT"] = FILENUM + " '%s' Statements Only Process Variables. Extra Text Ignored" +Messages["wENDLITMISS"] = FILENUM + "Missing '%s' Statement. All lines treated literally to end-of-file" % ENDLITERAL +Messages["wENDLITEXTRA"] = FILENUM + "'%s' Statement Without Preceding '%s'. Statement Ignored" % (ENDLITERAL, LITERAL) +Messages["wEXTRATEXT"] = FILENUM + " '%s' Statements Only Process Variables. Extra Text Ignored" +Messages["wLITEXTRA"] = FILENUM + "Already In A Literal Block. '%s' Statement Ignored" % LITERAL # Determine Length Of Longest Message Type @@ -496,15 +498,23 @@ ##### # LITERAL and ENDLITERAL Processing # These get highest precedence because they block everything else. + # However, they are ignored within False conditional blocks. ##### - if line.strip() in (LITERAL, ENDLITERAL): + if line.strip() in (LITERAL, ENDLITERAL) and CondStack[-1]: if line.strip() == LITERAL: - INLITERAL = True + if INLITERAL: + WarningMsg("wLITEXTRA", (cfgfile, linenum)) + else: + INLITERAL = True + # Process ENDLITERAL statements else: - INLITERAL = False + if not INLITERAL: + WarningMsg("wENDLITEXTRA", (cfgfile, linenum)) + else: + INLITERAL = False if DEBUG: