From a167a22bd0aa40632fe4c55c5d84ceeea41e255c Mon Sep 17 00:00:00 2001 From: Mike Hiretsky Date: Wed, 23 Sep 2015 11:17:46 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=B2=D0=B7=D0=B0=D0=B8=D0=BC=D0=BE=D0=B4?= =?UTF-8?q?=D0=B5=D0=B9=D1=81=D1=82=D0=B2=D0=B8=D0=B5=20=D1=81=20ac=5F=20?= =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=BD=D1=8B=D0=BC?= =?UTF-8?q?=D1=8B=20=D0=BD=D0=B5=D1=83=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=BC=D0=BE=D0=B4?= =?UTF-8?q?=D1=83=D0=BB=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pym/calculate/lib/datavars.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pym/calculate/lib/datavars.py b/pym/calculate/lib/datavars.py index 8d439a8..5d51aa3 100644 --- a/pym/calculate/lib/datavars.py +++ b/pym/calculate/lib/datavars.py @@ -56,6 +56,9 @@ class CriticalError(Exception): class DataVarsError(Exception): """Exception of getting variable values""" +class ImportModuleDataVarsError(DataVarsError): + """Ошибка импортирования модуля""" + class VariableError(Exception): """Exception of sended by Variable""" @@ -1137,7 +1140,7 @@ class DataVars(SimpleDataVars): raise DataVarsError(_("Variable %s not found")%varname) def raiseModuleError(self,module,error,*args,**kwargs): - raise DataVarsError("\n".join([ + raise ImportModuleDataVarsError("\n".join([ _("Failed to import module %s")%module, _("error") + ": " +str(error)])) @@ -1318,7 +1321,12 @@ class DataVars(SimpleDataVars): section,varname = self.splitVarname(varname) if not varname in self.loadVariables or \ not section in self.importedModules: - self.loadVariable(varname,section=section) + try: + self.loadVariable(varname,section=section) + except ImportModuleDataVarsError: + if varname.startswith("ac_"): + return "" + raise varObj = self.loadVariables[varname] # check section