Добавлен вывод отладочной информации. Изменен формат хранения табличных

переменных.
master3.3
Mike Hiretsky 11 years ago
parent 39fb51e33c
commit bd7659265c

@ -798,7 +798,7 @@ class SimpleDataVars:
if "list" in varType:
return ",".join(map(fixEmpty,value))
elif "table" in varType:
return ";".join(map(lambda x:",".join(map(fixEmpty,x)),
return ",".join(map(lambda x:":".join(map(fixEmpty,x)),
value))
return fixEmpty(value)
@ -807,12 +807,16 @@ class SimpleDataVars:
Unserialize form string for varname
"""
fixEmpty = lambda x:"" if x=="''" else x
def getList(val):
return map(fixEmpty,value.split(','))
def getList(delimeter=','):
def wrapper(val):
if val == "":
return []
return map(fixEmpty,val.split(delimeter))
return wrapper
if "list" in varType:
return getList(value)
return getList()(value)
if "table" in varType:
return map(getList,value.split(';'))
return map(getList(':'),value.split(','))
return fixEmpty(value).strip("'")
@ -1494,6 +1498,19 @@ class DataVars(SimpleDataVars):
else:
yield w
def printGroup(self,info):
"""
Вывести группу переменных
"""
print "=DEBUG.SET="
for vname in sorted(filter(lambda x:x.lower() == x,
info._type_info.keys())):
print "|", vname,"=",getattr(info,vname)
print "=DEBUG.DATAVARS="
for vname in self.mapVarGroup.keys():
print "|", vname, "=", self.Get(vname)
print "=DEBUG.END="
def checkGroups(self,info,allvars=False):
"""
Check variables in group or all in info

@ -403,7 +403,7 @@ class VariableClTemplateCltSet(ReadonlyVariable):
def get(self):
return "on" if "clt" in self.Get('cl_templates_locate') else "off"
class VariableClEnvDebugSet(ReadonlyVariable):
class VariableClEnvDebugSet(Variable):
"""
Переменная для включения отладки
"""

Loading…
Cancel
Save