Add to header config files "For modify this file, create %(conf_path)s.clt template."

develop
Самоукин Алексей 14 years ago
parent 2712f2cb92
commit 2ef9f17a28

@ -3218,6 +3218,7 @@ class template(_file,_terms,_warning,xmlShare,templateFormat,_shareTemplate):
"""
# Название файла шаблона директории
templDirNameFile = ".calculate_directory"
titleEnd = "For modify this file, create %(conf_path)s.clt template."
def __init__(self, objVar, servDir=False, dirsFilter=[], filesFilter=[],
cltObj=True, cltFilter=True, printWarning=True):
@ -3447,8 +3448,11 @@ re.M|re.S)
self.setError(_("name template not valid: ")+ str(fileTemplate))
return False
def getTitle(self, comment, commentList):
def getTitle(self, comment, commentList, configPath=""):
"""Выдает заголовок шаблона ( версия и.т.д)"""
if configPath:
commentList = commentList +\
[self.titleEnd%{'conf_path':configPath}]
if comment:
commentFirst = comment
commentInsert = comment
@ -4485,7 +4489,8 @@ variable 'cl-name'"))
# Титл конфигурационного файла
title = ""
if ListOptTitle:
title = self.getTitle(objHeadNew.comment, ListOptTitle)
title = self.getTitle(objHeadNew.comment, ListOptTitle,
configPath=nameFileConfig)
title = title.encode("UTF-8")
objHeadOld = False
@ -4579,7 +4584,8 @@ variable 'cl-name'"))
# Титл для объединения
if ListOptTitle:
title = self.getTitle(objTemplNew._comment,
ListOptTitle)
ListOptTitle,
configPath=nameFileConfig)
title = title.encode("UTF-8")
# Замена
if typeAppendTemplate == "replace":
@ -4662,7 +4668,8 @@ variable 'cl-name'"))
# Титл для объединения
if ListOptTitle:
title = self.getTitle(objTemplNew._comment,
ListOptTitle)
ListOptTitle,
configPath=nameFileConfig)
title = title.encode("UTF-8")
# В случае пустого конфигурационного файла

Loading…
Cancel
Save