diff --git a/tconfpy.py b/tconfpy.py index 3300bb9..788d62e 100755 --- a/tconfpy.py +++ b/tconfpy.py @@ -6,7 +6,7 @@ # Program Information PROGNAME = "tconfpy" -RCSID = "$Id: tconfpy.py,v 1.141 2004/03/25 00:52:31 tundra Exp $" +RCSID = "$Id: tconfpy.py,v 1.142 2004/03/25 01:29:17 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -372,7 +372,29 @@ # Make sure a valid descriptor was passed for each variable - if isinstance(des, VarDescriptor): + desok = True + + # Make sure we got a Var Descriptor Object + if not isinstance(des, VarDescriptor): + desok = False + + # Check various entries for type agreement + + dt = des.Type + + if des.Default and type(des.Default) != dt: + desok = False + + for lv in des.LegalVals: + if type(lv) != dt: + desok = False + + for mm in (des.Min, des.Max): + if mm and type(mm) != TYPE_INT: + desok = False + + # Update or error based on validity of descriptor + if desok: SymTable[sym] = des # Invalid descriptor passed