git-svn-id: http://svn.calculate.ru/calculate2/calculate-lib/trunk@52 c91db197-33c1-4113-bf15-f8a5c547ca64

master3.3
asamoukin 16 years ago
parent f4c25fbe5d
commit fd5f19fe57

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

Loading…
Cancel
Save