diff options
author | 2021-10-14 08:00:04 +1100 | |
---|---|---|
committer | 2021-10-14 08:00:04 +1100 | |
commit | 96ca1dbd965df08ed4ab1f23053690c9ce540f94 (patch) | |
tree | 7c357aa9efe72e7e9c8b6e7084cec9fa859e214a /scripts/minimaws/lib/lxparse.py | |
parent | 75f9660fa29d3d68a522fa96dbc92ef02baff2b8 (diff) |
More user experience improvements:
frontend: Allow clicking the adjuster arrows on menu items. This allows
things like video options and DIP switches to be configured using a
mouse only. Also fixed a bug preventing paging menus with a mouse if
the first item scrolled off the bottom is not selectable.
debugger: Allow wplist and bplist to accept a CPU argument to list
breakpoints/watchpoints for a single CPU only.
debugger: Fixed some corner cases in address space syntax in memory
accesses, and allowed memory region accesses to use tags relative to the
visible CPU.
emu/softlist.cpp: Ignore notes elements when loading software lists.
It's effectively a comment that isn't a comment syntactically, it's
being used for things that are not useful to display in the internal UI,
and it slows down startup.
docs: Updated three more pages of debugger documentation. Also updated
more of the built-in debugger help.
minimaws: Fixed up schema for software list notes, made sofware list
notes display initially collapsed.
Diffstat (limited to 'scripts/minimaws/lib/lxparse.py')
-rw-r--r-- | scripts/minimaws/lib/lxparse.py | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/scripts/minimaws/lib/lxparse.py b/scripts/minimaws/lib/lxparse.py index 699695577fc..e773669080d 100644 --- a/scripts/minimaws/lib/lxparse.py +++ b/scripts/minimaws/lib/lxparse.py @@ -391,11 +391,14 @@ class SoftwareHandler(ElementHandler): if self.cloneof is not None: self.dbcurs.add_softwarecloneof(self.id, self.cloneof) elif name == 'notes': - self.notes = handler.text - self.dbcurs.update_software_notes(self.id, self.notes) + self.dbcurs.add_softwarenotes(self.id, handler.text) class SoftwareListHandler(ElementHandler): + CHILD_HANDLERS = { + 'notes': TextAccumulator, + 'software': SoftwareHandler } + def __init__(self, dbconn, **kwargs): super(SoftwareListHandler, self).__init__(parent=None, **kwargs) self.dbconn = dbconn @@ -414,33 +417,28 @@ class SoftwareListHandler(ElementHandler): locator=self.locator) self.shortname = attrs['name'] self.description = attrs['description'] - self.notes = None self.entries = 0 dbcurs = self.dbconn.cursor() self.id = dbcurs.add_softwarelist(self.shortname, self.description) dbcurs.close() def endMainElement(self, name): - if self.notes: - dbcurs = self.dbconn.cursor() - dbcurs.update_softwarelist_notes(self.id, self.notes) - dbcurs.close() self.dbconn.commit() def startChildElement(self, name, attrs): - if name == 'notes': - self.setChildHandler(name, attrs, TextAccumulator(self)) - elif name == 'software': - self.setChildHandler(name, attrs, SoftwareHandler(self)) + if name in self.CHILD_HANDLERS: + self.setChildHandler(name, attrs, self.CHILD_HANDLERS[name](self)) else: raise xml.sax.SAXParseException( - msg=('Expected "software" element but found "%s"' % (name, )), + msg=('Found unexpected element "%s"' % (name, )), exception=None, locator=self.locator) def endChildHandler(self, name, handler): if name == 'notes': - self.notes = handler.text + dbcurs = self.dbconn.cursor() + dbcurs.add_softwarelistnotes(self.id, handler.text) + dbcurs.close() elif name == 'software': if self.entries >= 1023: self.dbconn.commit() |