|
|
|
@ -1897,11 +1897,12 @@ class profile(_file, _terms):
|
|
|
|
|
self.closeFiles()
|
|
|
|
|
|
|
|
|
|
def __getApplyHeadProfile(self ,newFile, oldFile):
|
|
|
|
|
self.nameFileNew = self.absFileName(newFile)
|
|
|
|
|
self.closeFiles()
|
|
|
|
|
self.FN = self.openNewFile(self.nameFileNew)
|
|
|
|
|
self.newProfile = self.FN.read()
|
|
|
|
|
self.closeNewFile()
|
|
|
|
|
if not self.newProfile:
|
|
|
|
|
self.nameFileNew = self.absFileName(newFile)
|
|
|
|
|
self.FN = self.openNewFile(self.nameFileNew)
|
|
|
|
|
self.newProfile = self.FN.read()
|
|
|
|
|
self.closeNewFile()
|
|
|
|
|
objHeadNew = calcHeader(self.newProfile, False,
|
|
|
|
|
self.getFileType(),objVar=self.objVar)
|
|
|
|
|
if not objHeadNew.headerTerm:
|
|
|
|
@ -2021,17 +2022,21 @@ class profile(_file, _terms):
|
|
|
|
|
ListOptTitle - список строк которые добавятся в заголовок
|
|
|
|
|
"""
|
|
|
|
|
# Выполняем условия для блока текста а так-же заменяем переменные
|
|
|
|
|
self.newProfile = ""
|
|
|
|
|
self.nameFileNew = self.absFileName(newFile)
|
|
|
|
|
self.FN = self.openNewFile(self.nameFileNew)
|
|
|
|
|
self.newProfile = self.FN.read()
|
|
|
|
|
self.closeNewFile()
|
|
|
|
|
if self.getFileType() != "bin":
|
|
|
|
|
self.newProfile = self.applyTermsProfile(self.newProfile,
|
|
|
|
|
newFile)
|
|
|
|
|
#print "|%s|" %(self.newProfile)
|
|
|
|
|
self.newProfile = self.applyVarsProfile(self.newProfile)
|
|
|
|
|
|
|
|
|
|
objHeadNew = self.__getApplyHeadProfile(newFile, oldFile)
|
|
|
|
|
if not objHeadNew:
|
|
|
|
|
return True
|
|
|
|
|
self.newProfile = objHeadNew.body
|
|
|
|
|
print "#%s#" %(objHeadNew.body)
|
|
|
|
|
#if objHeadNew.fileType != "bin":
|
|
|
|
|
#self.newProfile = self.applyTermsProfile(self.newProfile,
|
|
|
|
|
#newFile)
|
|
|
|
@ -2053,8 +2058,6 @@ class profile(_file, _terms):
|
|
|
|
|
|
|
|
|
|
if objHeadNew.fileType:
|
|
|
|
|
# Создаем объект в случае параметра format в заголовке
|
|
|
|
|
print "Заголовок"
|
|
|
|
|
print objHeadNew.typeAppend, objHeadNew.fileType
|
|
|
|
|
if (objHeadNew.typeAppend == "replace" or\
|
|
|
|
|
objHeadNew.typeAppend == "before" or\
|
|
|
|
|
objHeadNew.typeAppend == "after") and\
|
|
|
|
@ -2087,6 +2090,11 @@ class profile(_file, _terms):
|
|
|
|
|
docObj.insertBeforeSepAreas(docObj.getNodeBody())
|
|
|
|
|
# Получение текстового файла из XML документа
|
|
|
|
|
self.newProfile = objProfNew.getConfig().encode("UTF-8")
|
|
|
|
|
# Титл для объединения
|
|
|
|
|
if ListOptTitle:
|
|
|
|
|
title = self.getTitle(objProfNew._comment,
|
|
|
|
|
ListOptTitle)
|
|
|
|
|
title = title.encode("UTF-8")
|
|
|
|
|
# Замена
|
|
|
|
|
if objHeadNew.typeAppend == "replace":
|
|
|
|
|
if objHeadNew.execStr:
|
|
|
|
|