|
|
|
@ -2789,30 +2789,6 @@ class templateFunction(_error, _shareTemplate, _shareTermsFunction):
|
|
|
|
|
textTemplateTmp[resS.end():]
|
|
|
|
|
return (textTemplateTmp)
|
|
|
|
|
|
|
|
|
|
def funcPop(self, funArgv, resS, localVars, textTemplateTmp):
|
|
|
|
|
"""локальная функция получает значение
|
|
|
|
|
|
|
|
|
|
из стека глобальных переменных и присваивает локальной переменной
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
terms = funArgv.replace(" ","").split(",")
|
|
|
|
|
# Название локальной переменной
|
|
|
|
|
nameLocVar = terms[0]
|
|
|
|
|
if len(terms) == 1:
|
|
|
|
|
if self.stackGlobalVars:
|
|
|
|
|
localVars[nameLocVar] = self.stackGlobalVars.pop()
|
|
|
|
|
else:
|
|
|
|
|
self.printErrTemplate()
|
|
|
|
|
print _("error, gloval variables stack is empty")
|
|
|
|
|
cl_overriding.exit(1)
|
|
|
|
|
else:
|
|
|
|
|
self.printErrTemplate()
|
|
|
|
|
cl_overriding.exit(1)
|
|
|
|
|
replace = ""
|
|
|
|
|
textTemplateTmp = textTemplateTmp[:resS.start()] + replace +\
|
|
|
|
|
textTemplateTmp[resS.end():]
|
|
|
|
|
return textTemplateTmp
|
|
|
|
|
|
|
|
|
|
def funcReplace(self, funArgv, resS, localVars, textTemplateTmp):
|
|
|
|
|
"""локальная функция заменяет в значении переменной old на new
|
|
|
|
|
|
|
|
|
@ -2899,9 +2875,15 @@ class templateFunction(_error, _shareTemplate, _shareTermsFunction):
|
|
|
|
|
из /var/calculate/remote/calculate.env
|
|
|
|
|
"""
|
|
|
|
|
terms = funArgv.replace(" ","").split(",")
|
|
|
|
|
if len(terms) != 1:
|
|
|
|
|
if len(terms)==0 or len(terms)>2:
|
|
|
|
|
self.printErrTemplate()
|
|
|
|
|
cl_overriding.exit(1)
|
|
|
|
|
nameLocalVar = ""
|
|
|
|
|
if len(terms)==2:
|
|
|
|
|
if not terms[1]:
|
|
|
|
|
self.printErrTemplate()
|
|
|
|
|
cl_overriding.exit(1)
|
|
|
|
|
nameLocalVar = terms[1]
|
|
|
|
|
textLine = terms[0]
|
|
|
|
|
vals = textLine.split(".")
|
|
|
|
|
if len(vals)!= 2:
|
|
|
|
@ -2929,7 +2911,11 @@ class templateFunction(_error, _shareTemplate, _shareTermsFunction):
|
|
|
|
|
self.optionsInfo = optInfo
|
|
|
|
|
replace = ''
|
|
|
|
|
if service in self.optionsInfo and option in self.optionsInfo[service]:
|
|
|
|
|
replace = self.optionsInfo[service][option]
|
|
|
|
|
value = self.optionsInfo[service][option]
|
|
|
|
|
if nameLocalVar:
|
|
|
|
|
localVars[nameLocalVar] = value
|
|
|
|
|
else:
|
|
|
|
|
replace = value
|
|
|
|
|
textTemplateTmp = textTemplateTmp[:resS.start()] + replace +\
|
|
|
|
|
textTemplateTmp[resS.end():]
|
|
|
|
|
return textTemplateTmp
|
|
|
|
|