1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-14 08:16:15 +01:00

Add File.to_xml_node() method

This commit is contained in:
Daniel Mach 2022-10-24 16:29:53 +02:00
parent a7b58e86a0
commit e56773bbaa

View File

@ -276,6 +276,18 @@ class File:
} }
return cls(**kwargs) return cls(**kwargs)
def to_xml_node(self, parent_node):
attributes = {
"name": self.name,
"md5": self.md5,
"size": str(int(self.size)),
"mtime": str(int(self.mtime)),
}
if self.skipped:
attributes["skipped"] = "true"
new_node = ET.SubElement(parent_node, "entry", attributes)
return new_node
class Serviceinfo: class Serviceinfo:
"""Source service content """Source service content