ospalh / anki-addons

A collection of Anki 2.1 addons in different states of bugginess, up-to-dateness and usefulness.
http://ospalh.github.io/anki-addons/
135 stars 60 forks source link

I get this error after installing the addon #129

Open patshan opened 5 years ago

patshan commented 5 years ago

Debug info:

Anki 2.1.12 (eef86bf3) Python 3.6.7 Qt 5.12.1 PyQt 5.11.3

Platform: Mac 10.14.4

Flags: frz=True ao=True sv=1

Caught exception:

File "aqt/webview.py", line 27, in cmd

File "aqt/webview.py", line 85, in _onCmd

File "aqt/webview.py", line 363, in _onBridgeCmd

File "aqt/toolbar.py", line 56, in _linkHandler

File "aqt/toolbar.py", line 71, in _addLinkHandler

File "aqt/main.py", line 853, in onAddCard

File "aqt/init.py", line 82, in open

File "aqt/addcards.py", line 27, in init

File "aqt/addcards.py", line 39, in setupEditor

File "aqt/editor.py", line 53, in init

File "aqt/editor.py", line 96, in setupWeb

File "anki/hooks.py", line 39, in runFilter

<class 'TypeError'>: editor_add_download_editing_button() takes 1 positional argument but 2 were given

ospalh commented 5 years ago

Which addon?

patshan commented 5 years ago

Which addon?

It is the not forvo audio download add on

https://ankiweb.net/shared/info/3100585138

omdenis commented 5 years ago

Yep, it does not work :-(

Maybe it's due to these changes

please, please, please :-)


In Anki 2.1, a hook was added for adding buttons to the editor. It can be used like so:

from aqt.utils import showInfo from anki.hooks import addHook

def onStrike(editor): editor.web.eval("wrap('', '');")

def addMyButton(buttons, editor): editor._links['strike'] = onStrike return buttons + [editor._addButton( "iconname", # "/full/path/to/icon.png", "strike", # link name "tooltip")]

addHook("setupEditorButtons", addMyButton)