From 8e31f22bcd1e69b1b50bfdc3d615a98e61ac1c4b Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sat, 28 Sep 2019 21:25:50 +1000 Subject: minimaws: load ROMs and disks, and add a romident subcommand --- scripts/minimaws/lib/lxparse.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'scripts/minimaws/lib/lxparse.py') 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): -- cgit v1.2.3-70-g09d2