mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-10 22:56:15 +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)
|
||||
|
||||
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:
|
||||
"""Source service content
|
||||
|
Loading…
Reference in New Issue
Block a user