Added code to prevent variable names beginning with DOLLAR.
1 parent 16da6c7 commit fc7522429f77b4eb0015ec0e981634d4b9c24d93
@tundra tundra authored on 2 Apr 2004
Showing 1 changed file
View
8
tconfpy.py
 
# Program Information
 
PROGNAME = "tconfpy"
RCSID = "$Id: tconfpy.py,v 1.159 2004/04/02 09:11:55 tundra Exp $"
RCSID = "$Id: tconfpy.py,v 1.160 2004/04/02 09:21:19 tundra Exp $"
VERSION = RCSID.split()[2]
 
# Copyright Information
 
Messages["eSTRINGSHORT"] = FILENUM + "Right-Hand-Side Too Short. '%s' Must Be At Least %s Characters Long"
Messages["eTYPEBAD"] = FILENUM + "Type Mismatch. '%s' Must Be Assigned Values Of Type %s Only"
Messages["eVALLARGE"] = FILENUM + "%s Is Larger Than The Maximum Allowed, %s, For Variable '%s'"
Messages["eVALSMALL"] = FILENUM + "%s Is Smaller Than The Minimum Allowed, %s, For Variable '%s'"
Messages["eVARDOLLAR"] = FILENUM + "Variable Name Cannot Begin With The '%s' Symbol" % DOLLAR
Messages["eVARNAMESPC"] = FILENUM + "Variable Names May Not Contain Whitespace"
Messages["eVARNONAME"] = FILENUM + "Variable Name Evaluates To Null String. Not Permitted"
Messages["eVARREADONLY"] = FILENUM + "Variable '%s' Is Read-Only. Cannot Change Its Value"
Messages["eVARUNDEF"] = FILENUM + "Attempt To Reference Undefined Variable '%s'"
 
if not l:
ErrorMsg("eVARNONAME", (cfgfile, linenum))
# Suppress attempts to set variables named with leading DOLLAR
 
elif l[0] == DOLLAR:
ErrorMsg("eVARDOLLAR", (cfgfile, linenum))
 
# Suppress any attempt to change a RO variable
 
elif l in SymTable and not SymTable[l].Writeable:
ErrorMsg("eVARREADONLY", (cfgfile, linenum, l))