Fix check variable

master3.3
Mike Hiretsky 12 years ago
parent 7e5439265b
commit 15731a5afc

@ -98,9 +98,10 @@ class Variable:
"""
self.checking = False
self.invalid = self.value is None
self.wasSet = False
self.reqVars = []
self.reqCheck = []
self.wasSet = False # variable is user or ini set
self.reqVars = [] # varaibles which used this value for fill
self.reqCheck = [] # variables which used this value for check
self.reqUncompat = [] # varaibles which used this value for uncompat
self.variableType = type
self.parent = parent
self.name = self.getVariableName()
@ -256,6 +257,12 @@ class Variable:
self.wasSet = True
self.invalid = False
# run check
self.checkValue()
def checkValue(self):
"""
Full check value
"""
try:
self.checking = True
self.untrusted = True
@ -278,7 +285,8 @@ class Variable:
var.invalidate()
for var in self.reqCheck:
var.untrusted = True
#self.reqVars = []
self.reqVars = []
self.reqCheck = []
def isTrue(self,value):
if value.lower() in ('yes','on','true'):
@ -587,7 +595,7 @@ class DataVars:
if varObj.source and Variable.get.__func__ == varObj.get.__func__:
self.__checkTable(varObj, value)
else:
varObj.check(value)
varObj.checkValue()
def Choice(self, varname):
"""
@ -769,7 +777,8 @@ class DataVars:
varvalue = {True:'on',False:'off'}.get(varvalue)
varObj._set(varvalue)
else:
raise DataVarsError(_("Attempt to rewrite a readonly variable")+": %s"%varname)
raise DataVarsError(
_("Attempt to rewrite a readonly variable")+": %s"%varname)
def Invalidate(self,varname,force=False,onlySet=False):
"""

Loading…
Cancel
Save