From 2ef9f17a28edac5e42d16385180edd719351adb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B0=D0=BC=D0=BE=D1=83=D0=BA=D0=B8=D0=BD=20=D0=90?= =?UTF-8?q?=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= Date: Fri, 15 Oct 2010 12:27:29 +0400 Subject: [PATCH] Add to header config files "For modify this file, create %(conf_path)s.clt template." --- pym/cl_template.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pym/cl_template.py b/pym/cl_template.py index cadf5e5..4470720 100644 --- a/pym/cl_template.py +++ b/pym/cl_template.py @@ -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") # В случае пустого конфигурационного файла