Reorganize the code slightly to that blank lines would be passed
during Literal line processing (rather than ignored as in all other cases).
1 parent 6710542 commit d98a67a78712b672aaf8d39f6c8d2345ec2a936b
@tundra tundra authored on 21 Mar 2004
Showing 1 changed file
View
106
tconfpy.py
 
# Program Information
 
PROGNAME = "tconfpy"
RCSID = "$Id: tconfpy.py,v 1.126 2004/03/21 14:00:18 tundra Exp $"
RCSID = "$Id: tconfpy.py,v 1.127 2004/03/21 14:05:42 tundra Exp $"
VERSION = RCSID.split()[2]
 
# Copyright Information
 
##########
# Beginning Of Line Parser
##########
 
# Only attempt on non-blank lines
#####
# LITERAL and ENDLITERAL Processing
# These get highest precedence because they block everything else.
#####
 
if line in (LITERAL, ENDLITERAL):
 
if line == LITERAL:
INLITERAL = True
 
else:
INLITERAL = False
 
 
if DEBUG:
DebugMsg("dPARSEDLINE", (cfgfile, linenum, orig, line))
 
return
 
# We pass lines as-is, with optional variable replacement, in literal blocks
 
if INLITERAL:
 
if LITERALVARS:
line, ref_ok = DerefVar(line, cfgfile, linenum)
 
LiteralLines.append(line)
 
if DEBUG:
DebugMsg("dPARSEDLINE", (cfgfile, linenum, orig, line))
 
return
 
 
# Only attempt on non-blank lines for everything else
if line:
 
#####
# LITERAL and ENDLITERAL Processing
# These get highest precedence because they block everything else.
#####
 
if line in (LITERAL, ENDLITERAL):
 
if line == LITERAL:
INLITERAL = True
 
else:
INLITERAL = False
 
 
if DEBUG:
DebugMsg("dPARSEDLINE", (cfgfile, linenum, orig, line))
 
return
 
# We pass lines as-is, with optional variable replacement, in literal blocks
if INLITERAL:
 
if LITERALVARS:
line, ref_ok = DerefVar(line, cfgfile, linenum)
 
LiteralLines.append(line)
 
if DEBUG:
DebugMsg("dPARSEDLINE", (cfgfile, linenum, orig, line))
 
return
 
 
# Get first token on the line
FIRSTTOK = line.split()[0]