|
|
@ -25,13 +25,15 @@ import types
|
|
|
|
import random
|
|
|
|
import random
|
|
|
|
import string
|
|
|
|
import string
|
|
|
|
import time
|
|
|
|
import time
|
|
|
|
|
|
|
|
import glob
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Переопределение exit
|
|
|
|
# Переопределение exit
|
|
|
|
import cl_overriding
|
|
|
|
import cl_overriding
|
|
|
|
|
|
|
|
|
|
|
|
from cl_utils import _error, _warning, _toUNICODE, getModeFile, removeDir,\
|
|
|
|
from cl_utils import _error, _warning, _toUNICODE, getModeFile, removeDir,\
|
|
|
|
typeFile, scanDirectory, convertStrListDict, pathJoin
|
|
|
|
typeFile, scanDirectory, convertStrListDict, pathJoin,\
|
|
|
|
|
|
|
|
runOsCommand
|
|
|
|
|
|
|
|
|
|
|
|
import cl_lang
|
|
|
|
import cl_lang
|
|
|
|
tr = cl_lang.lang()
|
|
|
|
tr = cl_lang.lang()
|
|
|
@ -2268,7 +2270,6 @@ class templateFunction(_error, _shareTemplate, _shareTermsFunction):
|
|
|
|
# Текст функции шаблона
|
|
|
|
# Текст функции шаблона
|
|
|
|
functText = ""
|
|
|
|
functText = ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def __init__(self, objVar):
|
|
|
|
def __init__(self, objVar):
|
|
|
|
# Если не определен словарь функций шаблона
|
|
|
|
# Если не определен словарь функций шаблона
|
|
|
|
if not self.templateFunction:
|
|
|
|
if not self.templateFunction:
|
|
|
@ -3125,6 +3126,21 @@ os_disk_install not found mount point '\' and '\%s'")%mountPoint)
|
|
|
|
textTemplateTmp[resS.end():]
|
|
|
|
textTemplateTmp[resS.end():]
|
|
|
|
return textTemplateTmp
|
|
|
|
return textTemplateTmp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def funcExec(self, funArgv, resS, localVars, textTemplateTmp):
|
|
|
|
|
|
|
|
"""Функция шаблона exec().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Выполняет первый аргумент, при ошибке результат "" иначе "1"
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
retCode, outMess = runOsCommand(funArgv)
|
|
|
|
|
|
|
|
print outMess
|
|
|
|
|
|
|
|
if retCode == 0:
|
|
|
|
|
|
|
|
replace = "1"
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
replace = ""
|
|
|
|
|
|
|
|
textTemplateTmp = textTemplateTmp[:resS.start()] + replace +\
|
|
|
|
|
|
|
|
textTemplateTmp[resS.end():]
|
|
|
|
|
|
|
|
return textTemplateTmp
|
|
|
|
|
|
|
|
|
|
|
|
def printErrTemplate(self):
|
|
|
|
def printErrTemplate(self):
|
|
|
|
"""Печать ошибки при обработке функций шаблона"""
|
|
|
|
"""Печать ошибки при обработке функций шаблона"""
|
|
|
|
cl_overriding.printERROR(_("error in template %s")%self.nameTemplate)
|
|
|
|
cl_overriding.printERROR(_("error in template %s")%self.nameTemplate)
|
|
|
|