krmanik / Sentence-Adder-Anki-Addon

Add sentences to Anki editor window in one click
GNU Affero General Public License v3.0
14 stars 6 forks source link

Batch Adder Fails 'word_color' error. #29

Open Ms-Dance opened 2 months ago

Ms-Dance commented 2 months ago

I'm trying to batch add sentence and I'm getting the following Error: 'word_color'. I edited the python a little and found that if I initialize the config_data object, I don't get that error. I'm unfamiliar with how to debug Python so my research stops there. But when setting all the config_data data, I still get a Error: ' .

Here is the japanese sentences I'm trying to use. They are sentence pairs.

Sentence pairs in Japanese-English - 2024-06-26.zip

image

It's somewhere here that the error is occuring. In batch_edit.py:batch_edit_notes()

image

Also, it looks like the config data isn't being read from the imported file. Since I'm not getting the "db_contain_pair" UI to show up. It's failing the if statement.

image

Ms-Dance commented 2 months ago

If I add load_config() to the bottom of editor.py, then everything works

image

semuer commented 1 month ago

https://github.com/krmanik/Sentence-Adder-Anki-Addon/blob/0dd17aa562a82b871a047628ce0f7d1d6747c732/src/batch_edit.py#L127

It seems this line causes a empty error message ("") when executing batch add without a translate field. Add load_config() in editor.py and comment out batch_edit.py#L127 fixed the problem for me.