diff --git a/tconfpy.py b/tconfpy.py index 49a6a6a..5cdc1ec 100755 --- a/tconfpy.py +++ b/tconfpy.py @@ -6,7 +6,7 @@ # Program Information PROGNAME = "tconfpy" -RCSID = "$Id: tconfpy.py,v 1.132 2004/03/24 09:33:44 tundra Exp $" +RCSID = "$Id: tconfpy.py,v 1.133 2004/03/24 09:56:05 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -233,6 +233,7 @@ Messages["eENDIFMISS"] = FILENUM + "Missing %d" + " '%s' " % ENDIF + " Statement(s)" 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["eVARREADONLY"] = FILENUM + "Variable '%s' Is Read-Only. Cannot Change Its Value" Messages["eVARUNDEF"] = FILENUM + "Attempt To Reference Undefined Variable '%s'" @@ -753,10 +754,19 @@ l = line[:e].strip() r = line[e+1:].strip() - # Construct the entry and load it into the symbol table - d = VarDescriptor() - d.Value = r - SymTable[l] = d + # Suppress any attempt to change a RO variable + + if l in SymTable and not SymTable[l].Writeable: + + ErrorMsg("eVARREADONLY", (cfgfile, linenum, l)) + + # Load variable into the symbol table + + else: + + d = VarDescriptor() + d.Value = r + SymTable[l] = d ##### # Line Format Is Not In One Of The Recognized Forms - Syntax Error