mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-14 16:26:13 +01:00
Add File.to_xml_node() method
This commit is contained in:
parent
a7b58e86a0
commit
e56773bbaa
12
osc/core.py
12
osc/core.py
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user