1
0
mirror of https://github.com/mbirth/tcl_ota_check.git synced 2024-11-10 06:16:46 +00:00

Fix naming issue.

This commit is contained in:
Markus Birth 2018-02-11 01:56:56 +01:00
parent 75d23502a3
commit 3059ff13f7
Signed by: mbirth
GPG Key ID: A9928D7A098C3A9A

View File

@ -8,10 +8,10 @@ from .. import dumpmgr
class TclResult: class TclResult:
def __init__(self, xml: str): def __init__(self, xmlstr: str):
self.raw_xml = xml self.raw_xml = xmlstr
self.dumper = dumpmgr.DumpMgr() self.dumper = dumpmgr.DumpMgr()
self.dumper.write_dump(xml) self.dumper.write_dump(xmlstr)
def delete_dump(self): def delete_dump(self):
self.dumper.delete_last_dump() self.dumper.delete_last_dump()
@ -22,9 +22,9 @@ class TclResult:
return mdx.toprettyxml(indent=" ") return mdx.toprettyxml(indent=" ")
class CheckResult(TclResult): class CheckResult(TclResult):
def __init__(self, xml: str): def __init__(self, xmlstr: str):
super().__init__(xml) super().__init__(xmlstr)
root = ElementTree.fromstring(xml) root = ElementTree.fromstring(xmlstr)
self.curef = root.find("CUREF").text self.curef = root.find("CUREF").text
self.fvver = root.find("VERSION").find("FV").text self.fvver = root.find("VERSION").find("FV").text
self.tvver = root.find("VERSION").find("TV").text self.tvver = root.find("VERSION").find("TV").text
@ -36,9 +36,9 @@ class CheckResult(TclResult):
self.filehash = fileinfo.find("CHECKSUM").text self.filehash = fileinfo.find("CHECKSUM").text
class DownloadResult(TclResult): class DownloadResult(TclResult):
def __init__(self, xml: str): def __init__(self, xmlstr: str):
super().__init__(xml) super().__init__(xmlstr)
root = ElementTree.fromstring(xml) root = ElementTree.fromstring(xmlstr)
file = root.find("FILE_LIST").find("FILE") file = root.find("FILE_LIST").find("FILE")
self.fileid = file.find("FILE_ID").text self.fileid = file.find("FILE_ID").text
self.fileurl = file.find("DOWNLOAD_URL").text self.fileurl = file.find("DOWNLOAD_URL").text
@ -54,9 +54,9 @@ class DownloadResult(TclResult):
self.s3_slaves = [s.text for s in s3_slave_list] self.s3_slaves = [s.text for s in s3_slave_list]
class ChecksumResult(TclResult): class ChecksumResult(TclResult):
def __init__(self, xml: str): def __init__(self, xmlstr: str):
super().__init__(xml) super().__init__(xmlstr)
root = ElementTree.fromstring(xml) root = ElementTree.fromstring(xmlstr)
file = root.find("FILE_CHECKSUM_LIST").find("FILE") file = root.find("FILE_CHECKSUM_LIST").find("FILE")
self.file_addr = file.find("ADDRESS").text self.file_addr = file.find("ADDRESS").text
self.sha1_enc_footer = file.find("ENCRYPT_FOOTER").text self.sha1_enc_footer = file.find("ENCRYPT_FOOTER").text