Feature: пользовательские функции игнорируют расширения файлов

master 3.7.3.10
root 1 year ago
parent 5e25b585bc
commit fa004dd584

@ -3672,12 +3672,14 @@ class templateFunction(_error, _warning, _shareTemplate, _shareTermsFunction,
funcName, spl, funcEnd = self.functText.partition("(")
tempDirs = [x.split('profiles')[0] for x in self.objVar.Get('main.cl_template_path')]
customFunc = [dirPath for dirPath in tempDirs
if os.path.exists(pathJoin(dirPath, 'scripts'))
and funcName in os.listdir(pathJoin(dirPath, 'scripts'))]
if os.path.exists(pathJoin(dirPath, 'scripts/functions/'))
and funcName in [x.split('.')[0] for x in
os.listdir(pathJoin(dirPath, 'scripts/functions/'))]]
if customFunc:
primeTemp = customFunc[-1]
funArgv = funcEnd.rpartition(")")[0]
textTemplateTmp = subprocess.check_output([pathJoin(primeTemp, 'scripts', funcName), funArgv], encoding='UTF-8')
execName = [x for x in os.listdir(pathJoin(primeTemp, 'scripts/functions/')) if x.split('.')[0] == funcName][0]
textTemplateTmp = subprocess.check_output([pathJoin(primeTemp, 'scripts/functions/', execName), funArgv], encoding='UTF-8')
if textTemplateTmp is not None:
resS = funcSearch(textTemplateTmp)
else:

Loading…
Cancel
Save