From bd7659265c6c6823590b8d5b8ecda856c97e7d00 Mon Sep 17 00:00:00 2001 From: Mike Hiretsky Date: Thu, 16 Jan 2014 10:26:03 +0400 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=B2=D1=8B=D0=B2=D0=BE=D0=B4=20=D0=BE=D1=82=D0=BB?= =?UTF-8?q?=D0=B0=D0=B4=D0=BE=D1=87=D0=BD=D0=BE=D0=B9=20=D0=B8=D0=BD=D1=84?= =?UTF-8?q?=D0=BE=D1=80=D0=BC=D0=B0=D1=86=D0=B8=D0=B8.=20=D0=98=D0=B7?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=20=D1=84=D0=BE=D1=80=D0=BC=D0=B0?= =?UTF-8?q?=D1=82=20=D1=85=D1=80=D0=B0=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D1=82=D0=B0=D0=B1=D0=BB=D0=B8=D1=87=D0=BD=D1=8B=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit переменных. --- calculate/lib/datavars.py | 27 ++++++++++++++++++++++----- calculate/lib/variables/env.py | 2 +- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/calculate/lib/datavars.py b/calculate/lib/datavars.py index 1f57029..31c635f 100644 --- a/calculate/lib/datavars.py +++ b/calculate/lib/datavars.py @@ -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 diff --git a/calculate/lib/variables/env.py b/calculate/lib/variables/env.py index 83ecdb4..ff273e7 100644 --- a/calculate/lib/variables/env.py +++ b/calculate/lib/variables/env.py @@ -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): """ Переменная для включения отладки """