diff --git a/tconfpy.py b/tconfpy.py index 0943a44..4be09f2 100755 --- a/tconfpy.py +++ b/tconfpy.py @@ -6,7 +6,7 @@ # Program Information PROGNAME = "tconfpy" -RCSID = "$Id: tconfpy.py,v 2.105 2005/01/17 22:27:21 tundra Exp $" +RCSID = "$Id: tconfpy.py,v 2.106 2005/01/19 10:03:33 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -32,6 +32,7 @@ # Imports # #----------------------------------------------------------# +import copy import os import platform import re @@ -1156,6 +1157,8 @@ e = line.index(EQUAL) l = line[:e].strip() r = line[e+1:].strip() + templatename = l.split(NSSEP)[-1] + # Make sure symbol name is properly formed @@ -1226,18 +1229,12 @@ # 3) If var has no template, and TemplatesOnly=False -> Create new var # Rule 1 - - if varname in SymTable.Templates.Symbols: + if templatename in SymTable.Templates.Symbols: # Create the new variable - - SymTable.Symbols[l] = SymTable.Templates.Symbols[varname] - # If the RHS is blank, use the default value from the template - - if not r: - r = SymTable.Templates.Symbols[varname].Default - + SymTable.Symbols[l] = copy.copy(SymTable.Templates.Symbols[templatename]) + # Load the proposed value only if valid if ValidateValue(l, r, cfgfile, linenum):