Изменение на юникод строки поиска XML узлов в профиле типа xfce_xml

git-svn-id: http://svn.calculate.ru/calculate2/calculate-lib/trunk@1401 c91db197-33c1-4113-bf15-f8a5c547ca64
master
asamoukin 15 years ago
parent 426026d0d6
commit 79c2a39216

@ -3145,8 +3145,7 @@ class profile(_file, _terms, xmlShare):
self.setError (_("False profile: " ) + newFile)
return False
data = \
objProfOld.getConfig().split("\n")
#objProfOld.getConfig().encode("UTF-8").split("\n")
objProfOld.getConfig().encode("UTF-8").split("\n")
data.insert(1,title)
self.oldProfile = "\n".join(data)
else:
@ -5162,10 +5161,10 @@ Valid values attribute 'action': \
path = n.tagName
if n.hasAttribute("name"):
nName = n.getAttribute("name")
attrName = "attribute::name='%s'"%nName.encode("UTF-8")
attrName = u"attribute::name='%s'"%nName
if n.hasAttribute("type"):
nType = n.getAttribute("type")
attrType = "attribute::type='%s'"%nType.encode("UTF-8")
attrType = u"attribute::type='%s'"%nType
if n.hasAttribute("value"):
nValue = n.getAttribute("value")
if n.hasAttribute("action"):
@ -5178,14 +5177,14 @@ Valid values attribute 'action': \
self.setError(textError)
return False
if xmlOldNode.parentNode:
findStr = "child::%s"%path
findStr = u"child::%s"%path
strAttr = [attrName, attrType]
findAttr = filter(lambda x: x, strAttr)
findAttrStr = ''
if findAttr:
strAttr = ' and '.join(findAttr)
strAttr = u' and '.join(findAttr)
findAttrStr = "[%s]"%strAttr
findPath = "child::%s%s"%(path,findAttrStr)
findPath = u"child::%s%s"%(path,findAttrStr)
# Рабочая нода
if not workNode:
workNode = xmlOldNode.parentNode
@ -5281,4 +5280,4 @@ the same nodes at one level")
"""Получение текстового файла из XML документа"""
data = self.doc.toprettyxml(encoding='UTF-8').split("\n")
data = filter(lambda x: x.strip(), data)
return "\n".join(data).replace("\t"," ")
return "\n".join(data).replace("\t"," ").decode("UTF-8")

Loading…
Cancel
Save