summaryrefslogtreecommitdiffstatshomepage
path: root/scripts/minimaws/lib/lxparse.py
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2017-08-04 17:13:34 +1000
committer Vas Crabb <vas@vastheman.com>2017-08-04 17:13:34 +1000
commitd96933356cda8f865a80245f17dd79a527d267b2 (patch)
treea500720df7ed9a0f413ed0e5633fec78ad28a179 /scripts/minimaws/lib/lxparse.py
parent0bdd1df2e33555ef9779c4a2106d3d8fea16c410 (diff)
minimaws: demonstrate slot card BIOS selection, requires exposing device BIOS sets in XML output
Diffstat (limited to 'scripts/minimaws/lib/lxparse.py')
-rw-r--r--scripts/minimaws/lib/lxparse.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/scripts/minimaws/lib/lxparse.py b/scripts/minimaws/lib/lxparse.py
index aeab5c1266d..69d5b91ba0e 100644
--- a/scripts/minimaws/lib/lxparse.py
+++ b/scripts/minimaws/lib/lxparse.py
@@ -126,11 +126,11 @@ class DipSwitchHandler(ElementHandler):
while (0 != self.mask) and not (self.mask & 1):
self.mask >>= 1
self.bit += 1
- self.dbcurs.add_diplocation(self.id, self.bit, attrs['name'], attrs['number'], attrs['inverted'] == 'yes' if 'inverted' in attrs else False)
+ self.dbcurs.add_diplocation(self.id, self.bit, attrs['name'], attrs['number'], attrs.get('inverted', 'no') == 'yes')
self.mask >>= 1
self.bit += 1
elif (name == 'dipvalue') or (name == 'confsetting'):
- self.dbcurs.add_dipvalue(self.id, attrs['name'], attrs['value'], attrs['default'] == 'yes' if 'default' in attrs else False)
+ self.dbcurs.add_dipvalue(self.id, attrs['name'], attrs['value'], attrs.get('default', 'no') == 'yes')
self.setChildHandler(name, attrs, self.IGNORE)
@@ -167,8 +167,8 @@ class MachineHandler(ElementHandler):
def startMainElement(self, name, attrs):
self.shortname = attrs['name']
self.sourcefile = attrs['sourcefile']
- self.isdevice = attrs['isdevice'] == 'yes' if 'isdevice' in attrs else False
- self.runnable = attrs['runnable'] == 'yes' if 'runnable' in attrs else True
+ self.isdevice = attrs.get('isdevice', 'no') == 'yes'
+ self.runnable = attrs.get('runnable', 'yes') == 'yes'
self.cloneof = attrs.get('cloneof')
self.romof = attrs.get('romof')
self.dbcurs.add_sourcefile(self.sourcefile)
@@ -177,7 +177,11 @@ class MachineHandler(ElementHandler):
if name in self.CHILD_HANDLERS:
self.setChildHandler(name, attrs, self.CHILD_HANDLERS[name](self))
else:
- if name == 'device_ref':
+ if name == 'biosset':
+ bios = self.dbcurs.add_biosset(self.id, attrs['name'], attrs['description'])
+ if attrs.get('default', 'no') == 'yes':
+ self.dbcurs.add_biossetdefault(bios)
+ elif name == 'device_ref':
self.dbcurs.add_devicereference(self.id, attrs['name'])
elif name == 'feature':
self.dbcurs.add_featuretype(attrs['type'])