diff --git a/tconfpy.py b/tconfpy.py index 20e8463..272ce6b 100755 --- a/tconfpy.py +++ b/tconfpy.py @@ -6,7 +6,7 @@ # Program Information PROGNAME = "tconfpy" -RCSID = "$Id: tconfpy.py,v 2.109 2005/01/19 23:24:19 tundra Exp $" +RCSID = "$Id: tconfpy.py,v 2.110 2005/01/19 23:39:29 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -293,6 +293,7 @@ Messages["eEQUIVEXTRA"] = FILENUM + "Only a single '%s' Or '%s' Operator Permitted" % (EQUIV, NOTEQUIV) Messages["eIFEXTRATXT"] = FILENUM + "Extra Text On Line. '%s' Only Accepts Variable References As Arguments" Messages["eNOTLEGALVAL"] = FILENUM + "'%s' Not Found In List Of Legal Values For Variable '%s'" +Messages["eNOTSTRING"] = FILENUM + "%s Is Not A String Type - Ignoring" Messages["eSTRINGLONG"] = FILENUM + "'%s' Too Long For Variable '%s'. Maximum Length Is %s" Messages["eSTRINGSHORT"] = FILENUM + "'%s' Too Short For Variable '%s'. Minimum Length is %s" Messages["eSYMBADCHAR"] = FILENUM + "Symbol '%s' Contains Illegal Character '%s'" @@ -486,8 +487,8 @@ # It's an in-memory configuration if the passed parameter is a list elif cfgtype == type([]): - ParseInMemory(configuration) configname = INMEMORY + ParseInMemory(configuration, configname) pass # Anything else is illegal @@ -681,7 +682,7 @@ # Parse An In-Memory Configuration ########## -def ParseInMemory(cfglist): +def ParseInMemory(cfglist, configname): global SymTable @@ -691,8 +692,15 @@ SymTable.TotalLines += 1 - # Parse this line - ParseLine(line, INMEMORY, SymTable.TotalLines) + # The entry must be a string + if type(line) == TYPE_STRING: + + # Parse this line + ParseLine(line, configname, SymTable.TotalLines) + + # Anything else is a problem + else: + ErrorMsg("eNOTSTRING", (configname, SymTable.TotalLines, str(line))) # End of 'ParseInMemory()'