|
|
|
@ -789,6 +789,7 @@ class SimpleDataVars(object):
|
|
|
|
|
def __init__(self, *objs):
|
|
|
|
|
self.allVars = {}
|
|
|
|
|
self.cache = {}
|
|
|
|
|
self.changed = set()
|
|
|
|
|
for obj in objs:
|
|
|
|
|
obj.parent = self
|
|
|
|
|
self.allVars[obj.getVariableName()] = obj
|
|
|
|
@ -808,11 +809,14 @@ class SimpleDataVars(object):
|
|
|
|
|
def Set(self, varname, value):
|
|
|
|
|
varname = varname.rpartition(".")[2]
|
|
|
|
|
self.cache[varname] = value
|
|
|
|
|
self.changed.add(varname)
|
|
|
|
|
|
|
|
|
|
def Invalidate(self, varname):
|
|
|
|
|
varname = varname.rpartition(".")[2]
|
|
|
|
|
if varname in self.cache:
|
|
|
|
|
self.cache.pop(varname)
|
|
|
|
|
if varname in self.changed:
|
|
|
|
|
self.changed.remove(varname)
|
|
|
|
|
|
|
|
|
|
def GetBool(self,varname):
|
|
|
|
|
return Variable.isTrue(self.Get(varname))
|
|
|
|
@ -834,7 +838,7 @@ class SimpleDataVars(object):
|
|
|
|
|
return self.Get(item)
|
|
|
|
|
|
|
|
|
|
def __setitem__(self, key, value):
|
|
|
|
|
self.cache[key] = value
|
|
|
|
|
self.Set(key, value)
|
|
|
|
|
|
|
|
|
|
def prepare_all(self):
|
|
|
|
|
for var in self.allVars.keys():
|
|
|
|
@ -860,7 +864,7 @@ class SimpleDataVars(object):
|
|
|
|
|
(dict(config.items(varobj.section, raw=True))
|
|
|
|
|
if config.has_section(varobj.section)
|
|
|
|
|
else {})
|
|
|
|
|
if not varname in self.cache:
|
|
|
|
|
if not varname in self.changed:
|
|
|
|
|
val = self.unserialize(varobj.type or "string",
|
|
|
|
|
importVars[varobj.section].get(varname,'').encode('utf-8'))
|
|
|
|
|
if val and val != [[]] or varname in importVars[varobj.section]:
|
|
|
|
|