mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-26 01:46:13 +01:00
Add core.File.from_xml_node() class method
This commit is contained in:
parent
298a1fba4b
commit
e03cafa99a
12
osc/core.py
12
osc/core.py
@ -264,6 +264,18 @@ class File:
|
|||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_xml_node(cls, node):
|
||||||
|
assert node.tag == "entry"
|
||||||
|
kwargs = {
|
||||||
|
"name": node.get("name"),
|
||||||
|
"md5": node.get("md5"),
|
||||||
|
"size": int(node.get("size")),
|
||||||
|
"mtime": int(node.get("mtime")),
|
||||||
|
"skipped": "skipped" in node,
|
||||||
|
}
|
||||||
|
return cls(**kwargs)
|
||||||
|
|
||||||
|
|
||||||
class Serviceinfo:
|
class Serviceinfo:
|
||||||
"""Source service content
|
"""Source service content
|
||||||
|
Loading…
Reference in New Issue
Block a user