mirror of
https://github.com/openSUSE/osc.git
synced 2025-09-08 14:08:42 +02:00
Add File.to_xml_node() method
This commit is contained in:
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
|
||||
|
Reference in New Issue
Block a user