FastWordQuery icon indicating copy to clipboard operation
FastWordQuery copied to clipboard

My add-on doesn’t work at all.

Open leo-wiz opened this issue 4 years ago • 4 comments

Hello. My add-on doesn’t work at all. I don’t know why. It was working well on Anki 2.0.52 in the past. Sometimes I get bug.

Error An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.

If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.

When you’ve discovered the add-on that is causing the problem, please report the issue on the add-on support site.

Debug info:

Anki 2.1.35 (84dcaa86) Python 3.8.1 Qt 5.12.6 PyQt 5.12.3

Platform: Windows 7

Flags: frz=True ao=True sv=1

Add-ons, last update check: 2020-11-03 22:05:50

Caught exception:

Traceback (most recent call last):

File “C:\Users\leo\AppData\Roaming\Anki2\addons21\1807206748\common.py”, line 115, in

lambda mid=m[‘id’], i=i: set_options_def(mid, i))

File “C:\Users\leo\AppData\Roaming\Anki2\addons21\1807206748\common.py”, line 53, in set_options_def

config.update(data)

File “C:\Users\leo\AppData\Roaming\Anki2\addons21\1807206748\context.py”, line 61, in update

json.dump(

File “json_init_.py”, line 179, in dump

File “json\encoder.py”, line 431, in _iterencode

File “json\encoder.py”, line 353, in _iterencode_dict

TypeError: ‘<’ not supported between instances of ‘int’ and ‘str’

leo-wiz avatar Nov 03 '20 21:11 leo-wiz

I have tried x86-64 version and got error again

Error An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed. If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem. When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site. Debug info: Anki 2.1.35 (84dcaa86) Python 3.8.0 Qt 5.14.2 PyQt 5.14.2 Platform: Windows 7 Flags: frz=True ao=True sv=1 Add-ons, last update check: 2020-11-05 23:51:53

Caught exception: Traceback (most recent call last): File "C:\Users\leo\AppData\Roaming\Anki2\addons21\1807206748\common.py", line 115, in lambda mid=m['id'], i=i: set_options_def(mid, i)) File "C:\Users\leo\AppData\Roaming\Anki2\addons21\1807206748\common.py", line 53, in set_options_def config.update(data) File "C:\Users\leo\AppData\Roaming\Anki2\addons21\1807206748\context.py", line 61, in update json.dump( File "json_init_.py", line 179, in dump File "json\encoder.py", line 431, in _iterencode File "json\encoder.py", line 353, in _iterencode_dict TypeError: '<' not supported between instances of 'int' and 'str'

leo-wiz avatar Nov 06 '20 19:11 leo-wiz

sometime I can get "definition" and "phonetic symbols" and nothing more.

leo-wiz avatar Nov 06 '20 19:11 leo-wiz

looks like support and add-on is dead

leo-wiz avatar Nov 06 '20 19:11 leo-wiz

go to File “C:\Users\leo\AppData\Roaming\Anki2\addons21\1807206748\common.py” and find code block like below at about line 46

def set_options_def(mid, i):
    conf = config.get_maps(mid)
    conf = {'list': [conf], 'def': 0} if isinstance(conf, list) else conf
    if conf['def'] != i:
        conf['def'] = i
        data = dict()
        data[mid] = conf
        config.update(data)

and change to below

def set_options_def(mid, i):
    conf = config.get_maps(mid)
    conf = {'list': [conf], 'def': 0} if isinstance(conf, list) else conf
    if conf['def'] != i:
        conf['def'] = i
        data = dict()
        data[str(mid)] = conf  # <--- change this line
        config.update(data)

tosimplicity avatar Mar 21 '21 09:03 tosimplicity