diff options
author | 2017-08-04 11:39:32 +1000 | |
---|---|---|
committer | 2017-08-04 11:42:23 +1000 | |
commit | 00f6156cbbadfc01dcd2a7e91d26d55fa210dfab (patch) | |
tree | c8b7b3756c4a0d1bf64a78356bb438221fffdceb /scripts/minimaws/lib/dbaccess.py | |
parent | 0fbad045de7da6883d1930f81e895f59dc49c0b4 (diff) |
minimaws: show compatible slots for devices [Vas Crabb]
(nw) Identify Donkey Kong Junior (Japan set F-1) [Corrado Comaselli]
Diffstat (limited to 'scripts/minimaws/lib/dbaccess.py')
-rw-r--r-- | scripts/minimaws/lib/dbaccess.py | 7 |
1 files changed, 7 insertions, 0 deletions
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] |