Setting isPermaLink attrib to false when the guid is not a link

This commit is contained in:
Laszlo Zeke 2017-04-02 21:11:10 +02:00
parent 00b1cbdb1d
commit 620f4c3d20
1 changed files with 7 additions and 1 deletions

View File

@ -256,9 +256,15 @@ def _add_subelem(root_element, name, value):
subElem = ET.SubElement(root_element, name)
for key in value:
_add_subelem(subElem, key, value[key])
else:
if name == "guid" and not value.startswith("http"):
el = ET.SubElement(root_element, name)
el.text = value
el.attrib["isPermaLink"] = "false"
else:
ET.SubElement(root_element, name).text = value
def _stringify(tree, pretty):
"""