Add a UUID to projects

This commit is contained in:
Veronica Berglyd Olsen
2022-11-05 17:03:45 +01:00
parent 8b4dac4e13
commit c6d3f680cc
22 changed files with 91 additions and 40 deletions
+2 -1
View File
@@ -224,6 +224,7 @@ class ProjectXMLReader:
"""Parse the project section of the XML file.
"""
logger.debug("Parsing <project> section")
projData.setUuid(xSection.attrib.get("id", None))
for xItem in xSection:
if xItem.tag == "name":
projData.setName(xItem.text)
@@ -476,7 +477,7 @@ class ProjectXMLWriter:
})
# Save Project Meta
xProject = etree.SubElement(xRoot, "project")
xProject = etree.SubElement(xRoot, "project", attrib={"id": projData.uuid})
self._packSingleValue(xProject, "name", projData.name)
self._packSingleValue(xProject, "title", projData.title)
self._packListValue(xProject, "author", projData.authors)