master
asamoukin 16 years ago
parent 98c26775c9
commit f2150003b1

@ -114,6 +114,18 @@ class _terms(_error):
else:
listEqual.append(k)
else:
#проверка на допустимость названия переменной
reDenyName = re.compile("[^a-zA-Z0-9_-]")
if reDenyName.search(vals[0]):
self.setError("'%s'"%term + " " + _("incorrect"))
self.setError(textError)
return False
#проверка на допустимость значения значения
reDenyValue = re.compile("[^0-9a-zA-Z_\.-]")
if reDenyValue.search(vals[1]):
self.setError("'%s'"%term + " " + _("incorrect"))
self.setError(textError)
return False
try:
valVars = self.objVar.Get(vals[0])
except self.objVar.DataVarsError, e:
@ -129,12 +141,14 @@ class _terms(_error):
else:
listEqual.append("0")
else:
flagTxtTypeVar = True
flagIntTypeVar = True
try:
valVars = int(valVars)
except:
flagTxtTypeVar = False
if flagTxtTypeVar:
flagIntTypeVar = False
if flagIntTypeVar:
if not vals[1].strip():
vals[1] = 0
try:
valFile = int(vals[1])
except:
@ -148,6 +162,8 @@ class _terms(_error):
listEqual.append("0")
else:
if sepF == "!=" or sepF == "==":
if not vals[1].strip():
vals[1] = ""
valFile = vals[1]
valVar = valVars
exec("res=("+"'"+valVar+"'"+sepF+"'"+valFile+\

Loading…
Cancel
Save