sth2018 / FastWordQuery

Query words definitions or examples etc. from local or web dictionaries to fill into Anki cards.
https://ankiweb.net/shared/info/1807206748
GNU General Public License v3.0
270 stars 85 forks source link

勾选cloze选项,查询时报错插件无法使用。 #119

Open Jhering opened 5 years ago

Jhering commented 5 years ago

win10 64位,anki 2.1.8最新版 插件最新版。 勾选cloze选项,查询时报错,也就是说如果选了cloze word,这个插件是没法用的。 我在自定义cloze那里什么也没填。

image

报错如下:

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-ons section of our support site. Debug info: Anki 2.1.8 (71e0c880) Python 3.6.7 Qt 5.12.0 PyQt 5.11.3 Platform: Windows 10 Flags: frz=True ao=True sv=1

Caught exception: File "C:\Users\liwen\AppData\Roaming\Anki2\addons21\1807206748\common.py", line 76, in action.triggered.connect(lambda: query_from_browser(browser)) File "C:\Users\liwen\AppData\Roaming\Anki2\addons21\1807206748\query__init__.py", line 55, in query_from_browser query_from_editor_fields(browser.editor) File "C:\Users\liwen\AppData\Roaming\Anki2\addons21\1807206748\query__init.py", line 90, in query_from_editor_fields query_all([editor.note], flush, fields) File "C:\Users\liwen\AppData\Roaming\Anki2\addons21\1807206748\query\init__.py", line 113, in query_all work_manager.start() File "C:\Users\liwen\AppData\Roaming\Anki2\addons21\1807206748\query\worker.py", line 116, in start worker.run() File "C:\Users\liwen\AppData\Roaming\Anki2\addons21\1807206748\query\worker.py", line 63, in run results, success_num, missed_css = query_flds(note, self.manager.query_fields) File "C:\Users\liwen\AppData\Roaming\Anki2\addons21\1807206748\query\common.py", line 245, in query_flds qr['result'] = cloze_deletion(qr['result'], word) File "C:\Users\liwen\AppData\Roaming\Anki2\addons21\1807206748\query\common.py", line 292, in cloze_deletion result = result[:s+offset] + (config.cloze_str % w) + result[e+offset:] <class 'TypeError'>: not all arguments converted during string formatting

sth2018 commented 5 years ago

cloze word formater 不能为空,请参考默认设置

Jhering commented 5 years ago

问题是cloze word formater 的默认设置找不到啊,默认设置已经被我删除了,重新安装插件也不行,请问在哪里能找到呢。我并没有找到相关的文档。 如下填写 c1{{c1:: }}{{c1}} 还是一样的错误。

ps: 非常感谢您的无偿工作,您的这个软件给我的学习带来了非常大的便利,非常感谢!不知是否方便公开捐助账户,给您买杯咖啡。

sth2018 commented 5 years ago

默认值为:{{c1::%s}}

sth2018 commented 5 years ago

这里可换成其他你想要的形式,%s代表查询的单词,其他字符你可以更改,例如加粗<b>%s</b>

Jhering commented 5 years ago

谢谢。问题解决啦。