diff options
author | 2019-09-28 21:25:50 +1000 | |
---|---|---|
committer | 2019-09-28 21:25:50 +1000 | |
commit | 8e31f22bcd1e69b1b50bfdc3d615a98e61ac1c4b (patch) | |
tree | 61cc7ef61b0259c12c5df81215f2a82500ef77c1 /scripts/minimaws/lib/lxparse.py | |
parent | 1077396473a9b401c0dd8ea1407535b3717099db (diff) |
minimaws: load ROMs and disks, and add a romident subcommand
Diffstat (limited to 'scripts/minimaws/lib/lxparse.py')
-rw-r--r-- | scripts/minimaws/lib/lxparse.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/minimaws/lib/lxparse.py b/scripts/minimaws/lib/lxparse.py index dfd8cbae45e..96669ea99eb 100644 --- a/scripts/minimaws/lib/lxparse.py +++ b/scripts/minimaws/lib/lxparse.py @@ -206,6 +206,22 @@ class MachineHandler(ElementHandler): status = 0 if 'status' not in attrs else 2 if attrs['status'] == 'unemulated' else 1 overall = status if 'overall' not in attrs else 2 if attrs['overall'] == 'unemulated' else 1 self.dbcurs.add_feature(self.id, attrs['type'], status, overall) + elif name == 'rom': + crc = attrs.get('crc') + sha1 = attrs.get('sha1') + if (crc is not None) and (sha1 is not None): + crc = int(crc, 16) + sha1 = sha1.lower() + self.dbcurs.add_rom(crc, sha1) + status = attrs.get('status', 'good') + self.dbcurs.add_romdump(self.id, attrs['name'], crc, sha1, status != 'good') + elif name == 'disk': + sha1 = attrs.get('sha1') + if sha1 is not None: + sha1 = sha1.lower() + self.dbcurs.add_disk(sha1) + status = attrs.get('status', 'good') + self.dbcurs.add_diskdump(self.id, attrs['name'], sha1, status != 'good') self.setChildHandler(name, attrs, self.IGNORE) def endChildHandler(self, name, handler): |