From 00f6156cbbadfc01dcd2a7e91d26d55fa210dfab Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Fri, 4 Aug 2017 11:39:32 +1000 Subject: minimaws: show compatible slots for devices [Vas Crabb] (nw) Identify Donkey Kong Junior (Japan set F-1) [Corrado Comaselli] --- scripts/minimaws/lib/dbaccess.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scripts/minimaws/lib/dbaccess.py') diff --git a/scripts/minimaws/lib/dbaccess.py b/scripts/minimaws/lib/dbaccess.py index b1cc48b87b8..147986e0039 100644 --- a/scripts/minimaws/lib/dbaccess.py +++ b/scripts/minimaws/lib/dbaccess.py @@ -198,6 +198,13 @@ class QueryCursor(object): 'WHERE machine.id IN (SELECT machine FROM devicereference WHERE device = ?)', (device, )) + def get_compatible_slots(self, device): + return self.dbcurs.execute( + 'SELECT machine.shortname AS shortname, machine.description AS description, slot.name AS slot, slotoption.name AS slotoption, sourcefile.filename AS sourcefile ' \ + 'FROM slotoption JOIN slot ON slotoption.slot = slot.id JOIN machine on slot.machine = machine.id JOIN sourcefile ON machine.sourcefile = sourcefile.id ' + 'WHERE slotoption.device = ?', + (device, )) + def get_sourcefile_id(self, filename): return (self.dbcurs.execute('SELECT id FROM sourcefile WHERE filename = ?', (filename, )).fetchone() or (None, ))[0] -- cgit v1.2.3-70-g09d2