|
|
|
@ -904,7 +904,6 @@ class xmlDoc:
|
|
|
|
|
|
|
|
|
|
for removeNode in removeNodes:
|
|
|
|
|
xmlOldArea.removeChild(removeNode)
|
|
|
|
|
|
|
|
|
|
for node in sepListField:
|
|
|
|
|
node.setAttribute("type", "seplist")
|
|
|
|
|
if not (self.getActionField(node) == "join" or\
|
|
|
|
@ -1257,7 +1256,8 @@ class xmlDoc:
|
|
|
|
|
lastTmpNode = node
|
|
|
|
|
# Нода area
|
|
|
|
|
if node.tagName == "area":
|
|
|
|
|
if self.getActionArea(node) == "append":
|
|
|
|
|
if self.getActionArea(node) == "append" or\
|
|
|
|
|
self.getActionArea(node) == "join":
|
|
|
|
|
self.delActionNodeArea(node)
|
|
|
|
|
if lastNode and lastNode.hasAttribute("type") and\
|
|
|
|
|
lastNode.getAttribute("type") == "br" or\
|
|
|
|
@ -1277,7 +1277,8 @@ class xmlDoc:
|
|
|
|
|
self.insertBRtoBody(node)
|
|
|
|
|
# Нода field
|
|
|
|
|
else:
|
|
|
|
|
if self.getActionField(node) == "append":
|
|
|
|
|
if self.getActionField(node) == "append" or\
|
|
|
|
|
self.getActionField(node) == "join":
|
|
|
|
|
self.delActionNodeField(node)
|
|
|
|
|
if lastNode and lastNode.hasAttribute("type") and\
|
|
|
|
|
lastNode.getAttribute("type") == "br" or\
|
|
|
|
@ -2148,6 +2149,7 @@ class profile(_file, _terms):
|
|
|
|
|
# Добавление необходимых переводов строк
|
|
|
|
|
docObj.insertBRtoBody(docObj.getNodeBody())
|
|
|
|
|
# Добавление необходимых разделителей между областями
|
|
|
|
|
print docObj.doc.toprettyxml()
|
|
|
|
|
docObj.insertBeforeSepAreas(docObj.getNodeBody())
|
|
|
|
|
# Получение текстового файла из XML документа
|
|
|
|
|
self.newProfile = objProfNew.getConfig().encode("UTF-8")
|
|
|
|
@ -2255,7 +2257,6 @@ class profile(_file, _terms):
|
|
|
|
|
#print "#%s#" %(objProfOld.docObj.body.toprettyxml())
|
|
|
|
|
#print "#%s#" %(objProfNew.docObj.body.toprettyxml())
|
|
|
|
|
objProfOld.join(objProfNew)
|
|
|
|
|
print objProfOld.docObj.body.toprettyxml()
|
|
|
|
|
if objHeadNew.execStr:
|
|
|
|
|
self.oldProfile = objHeadNew.execStr + title +\
|
|
|
|
|
objProfOld.getConfig().encode("UTF-8")
|
|
|
|
@ -2303,10 +2304,11 @@ class samba(objShare):
|
|
|
|
|
if isinstance(sambaObj, samba):
|
|
|
|
|
self.docObj.joinDoc(sambaObj.doc)
|
|
|
|
|
# Для добавления перевода строки между областями если его нет
|
|
|
|
|
#print self.docObj.body.toprettyxml()
|
|
|
|
|
xmlAreas = xpath.Evaluate("child::area", self.docObj.body)
|
|
|
|
|
for xmlArea in xmlAreas:
|
|
|
|
|
if xmlArea.previousSibling and\
|
|
|
|
|
self.docObj.getActionField(xmlArea.previousSibling) == "br":
|
|
|
|
|
self.docObj.getTypeField(xmlArea.previousSibling) == "br":
|
|
|
|
|
continue
|
|
|
|
|
xmlFields = xpath.Evaluate("child::field", xmlArea)
|
|
|
|
|
if not (xmlFields and\
|
|
|
|
@ -3265,6 +3267,10 @@ class ldap(samba):
|
|
|
|
|
if f.name[0] == "!":
|
|
|
|
|
# Удаляемое в дальнейшем поле
|
|
|
|
|
docObj.setActionField(xmlField, "drop")
|
|
|
|
|
elif f.name[0] == "+":
|
|
|
|
|
# Добавляем уникальное поле
|
|
|
|
|
xmlField.setAttribute("type", "seplist")
|
|
|
|
|
docObj.setActionField(xmlField, "join")
|
|
|
|
|
else:
|
|
|
|
|
docObj.createField("var",[f.br.replace("\n","")],
|
|
|
|
|
f.name, [f.value])
|
|
|
|
|