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

downloadaudio Error on Anki 2.1.20 Beta 5 #136

Open
Kosezu opened this issue Jan 27, 2020 · 2 comments
Open

downloadaudio Error on Anki 2.1.20 Beta 5 #136

Kosezu opened this issue Jan 27, 2020 · 2 comments

Comments

@Kosezu
Copy link

Kosezu commented Jan 27, 2020

When loading 'Not Forvo audio downloader':
Traceback (most recent call last):
File "aqt/addons.py", line 192, in loadAddons
File "/Users/csosborn/Library/Application Support/Anki2/addons21/3100585138/init.py", line 25, in
from . import download
File "/Users/csosborn/Library/Application Support/Anki2/addons21/3100585138/download.py", line 48, in
from .get_fields import get_note_fields, get_side_fields
File "/Users/csosborn/Library/Application Support/Anki2/addons21/3100585138/get_fields.py", line 17, in
from .field_data import FieldData, JapaneseFieldData
File "/Users/csosborn/Library/Application Support/Anki2/addons21/3100585138/field_data.py", line 13, in
from anki.template import furigana
ImportError: cannot import name 'furigana' from 'anki.template' (/Applications/Anki 20 Beta.app/Contents/MacOS/anki/template.pyc)

@ospalh
Copy link
Owner

ospalh commented Jan 27, 2020

Quite possible.
I can’t get Anki 20 to run, and so maybe so much changed that that program can’t run my code either.
That means, of course, that i can’t fix this easily.

@alycm
Copy link
Contributor

alycm commented Mar 29, 2020

I had a quick look at this (it affect Anki 2.1.22 as well, unsurprisingly). Just grabbing the furigana.py file with the functions that were removed (https://github.com/ankitects/anki/blob/2.1.19/pylib/anki/template/furigana.py), dropping it into the addon and updating the imports removes this particular error. This obviously doesn't seem like a true fix, but although the 2.1.20 documentation has a fair amount of information on the changes to the hook system it's still not clear to me what the correct way to address this is.

I'm not going to create a PR because aside from being a hack, it is also an incomplete fix. The "play old" button when downloading audio does not work, anki.sound.playFromText is deprecated but doesn't seem to work at all.

Additional deprecation warnings are printed but don't seem to affect functionality yet. One about importing _ is trivial to fix, the other about anki.sound.stripSounds is not clear to me, other code that used that seems to have been rewritten to no longer require that functionality at all.

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