Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I get this error after installing the addon #129

Open
patshan opened this issue Jun 15, 2019 · 3 comments
Open

I get this error after installing the addon #129

patshan opened this issue Jun 15, 2019 · 3 comments

Comments

@patshan
Copy link

patshan commented Jun 15, 2019

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
Copy link
Owner

ospalh commented Jun 16, 2019

Which addon?

@patshan
Copy link
Author

patshan commented Jun 17, 2019

Which addon?

It is the not forvo audio download add on

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

@omdenis
Copy link

omdenis commented Jul 5, 2019

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)


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants