diff --git a/twander.py b/twander.py index 9b41570..ce7b2a1 100755 --- a/twander.py +++ b/twander.py @@ -6,7 +6,7 @@ # Program Information PROGNAME = "twander" -RCSID = "$Id: twander.py,v 3.164 2005/01/24 11:00:19 tundra Exp $" +RCSID = "$Id: twander.py,v 3.165 2005/01/24 11:55:28 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -557,6 +557,7 @@ CONF = "" # Config file user selected with -c option COMMENT = r"#" # Comment introducer string ENVVBL = r'$' # Symbol denoting an environment variable +FAKEFIELD = r'#FAKEFIELD' # Unsplittable field used to preserve PROMPT/YESNO content # Names Of Conditionals, Directives, And Pre-Defined Symbols @@ -722,6 +723,7 @@ # Warnings wBADCFGLINE = "Ignoring Line %s.\nBogus Configuration Entry:\n\n%s" +wBADCMD = "Incorrect Command Syntax At Line %s Of File %s" wBADDEBUG = "Ignoring Bogus Debug Level! - %s Is Not In Integer Or Hex Format." wBADENDIF = "Ignoring Line %s!\nBogus End-Of-Block Statement:\n\n%s" wBADENVVBL = "Ignoring Line %s.\nEnvironment Variable %s Not Set:\n\n%s" @@ -1178,7 +1180,7 @@ for match in matchtest.finditer(cleanline): found=match.group() saveliteral.append(found) - cleanline = cleanline.replace(found, PROMPT+str(index)) + cleanline = cleanline.replace(found, FAKEFIELD+str(index)) index += 1 @@ -1201,8 +1203,12 @@ if index == 2 and field.startswith(REFRESHAFTER): field = field[1:] - if field.startswith(PROMPT): - fields[index] = saveliteral[int(field[-1])] + if field.startswith(FAKEFIELD): + try: + fields[index] = saveliteral[int(field[-1])] + except: + WrnMsg(wBADCMD % (num, file)) + fields = [] index += 1