I have an add-on which allow to open multiple windows. So would like to know which browser has done the search. This
would allow me to have browser with various setting. In particular, I've an add-on which allow to show a single line by
note, and I would like for some browser to have this feature on and for some other to have this feature off.
Related to: https://github.com/ankitects/anki/pull 529
Ensuring "setNote" is called only once during changing of note type
After debugging the code, every time the cards changes, there are
two stacktraces generated and triggered when note cards change:
calling 1590591251.4621403
File "qt/runanki", line 4, in <module>
File "F:\anki\qt\aqt\__init__.py", line 365, in run
_run()
File "F:\anki\qt\aqt\__init__.py", line 515, in _run
app.exec()
File "F:\anki\qt\aqt\webview.py", line 467, in handler
cb(val)
File "F:\anki\qt\aqt\editor.py", line 477, in <lambda>
self.web.evalWithCallback("saveNow(%d)" % keepFocus, lambda res: callback())
File "F:\anki\qt\aqt\browser.py", line 858, in <lambda>
self.editor.saveNow(lambda: self._onRowChanged(current, previous))
File "F:\anki\qt\aqt\browser.py", line 880, in _onRowChanged
self._renderPreview(True)
File "F:\anki\qt\aqt\browser.py", line 1576, in _renderPreview
self._previewer.render_card(cardChanged)
File "F:\anki\qt\aqt\previewer.py", line 136, in render_card
print('calling', time.time(), "\n", "".join( traceback.format_stack() ) )
calling 1590591251.4766161
File "qt/runanki", line 4, in <module>
File "F:\anki\qt\aqt\__init__.py", line 365, in run
_run()
File "F:\anki\qt\aqt\__init__.py", line 515, in _run
app.exec()
File "F:\anki\qt\aqt\webview.py", line 467, in handler
cb(val)
File "F:\anki\qt\aqt\editor.py", line 453, in oncallback
gui_hooks.editor_did_load_note(self)
File "F:\anki\qt\aqt\gui_hooks.py", line 1168, in __call__
hook(editor)
File "F:\anki\qt\aqt\browser.py", line 887, in onLoadNote
self.refreshCurrentCard(editor.note)
File "F:\anki\qt\aqt\browser.py", line 884, in refreshCurrentCard
self._renderPreview(False)
File "F:\anki\qt\aqt\browser.py", line 1576, in _renderPreview
self._previewer.render_card(cardChanged)
File "F:\anki\qt\aqt\previewer.py", line 136, in render_card
print('calling', time.time(), "\n", "".join( traceback.format_stack() ) )
- notetypes are fetched from the DB as needed, and cached in Python
- handle note type changes in the backend. Multiple operations can now
be performed in one go, but this is not currently exposed in the GUI.
- extra methods to grab sorted note type names quickly, and fetch by
name
- col.models.save() without a provided notetype is now a no-op
- note loading/saving handled in the backend
- notes with no valid cards can now be added
- templates can now be deleted even if they would previously
orphan notes
a number of fixmes have been left in notes.py and models.py