Has the previewer code changed?

I have been programming an add-on on 2.1.26, recently switched to 2.1.35 and now it displays an error message:

widg.open()
File “aqt/previewer.py”, line 61, in open
File “aqt/previewer.py”, line 137, in render_card
File “aqt/previewer.py”, line 54, in card_changed
NotImplementedError

I can’t find any changes to the code on github, so any ideas why it’s not now working?

The code has changed quite a bit and some classes got removed altogether.

See:
previewer.py#L236

1 Like

That’s weird, I’m not using any of that code so that commit shouldn’t affect me.

I’m using the Previewer class which is in the latest version (or at least seems to be), but when i call open() it is coming up with the not implemented error. Why is this happening?

The Previewer class has no implementations for the card and card_changed methods (they both throw NotImplementedError). And they are both called indirectly by open.

You have to either write your own class that derives from Previewer and provides implementations for the missing methods, or simply use the BrowserPreviewer class (which is what Anki actually uses in the browser).

1 Like

That was it, thank you.

I was thrown off thinking it was the open not implemented.