Bug 746822

Summary: Anki Plugin won't work
Product: [Fedora] Fedora Reporter: Boris <knoe3301>
Component: ankiAssignee: Christian Krause <chkr>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: chkr
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-10-31 16:24:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Boris 2011-10-17 20:50:54 UTC
Using Anki 1.2.9 for Linux on Fedora 16beta (yum-installed)

Downloading plugin "Basic Chinese Support"
Creating a new deck, changing settings to Mandarin.
Now I type in a chinese word, e.g. 首先 ("expression" field).
As I continue to the "meaning" field, it should have filled the "reading" field with the Pinyin spelling shǒuxiān – but it stays empty.

(I tried it with Advanced Pinyin Toolkit as well, another common plugin for chinese learners – that plugin won't even start.)

I post this here and not in Anki's own bugtracker, because Version 1.2.8 in Fedora 15, used with the same plugin versions, will work properly.

Python related problem? Other libs?

Boris

Comment 1 Christian Krause 2011-10-17 21:46:02 UTC
Unfortunately I can't reproduce your problem since I don't have access to a F16 installation at the moment.

However, I have followed your instructions and I can confirm that at least in F15 it works without any issues.

Until I have access to a F16, please can you try the following: just start anki in a terminal like gnome-terminal and check, whether there is any debug output or error message.

Since this plugin uses sqlite to access its own unihan database, you can also try:

cd ~/.anki/plugins
sqlite3 unihan.db
select * from unihan;

Just compare the output roughly between F15 and F16. Probably this will help to determine the root cause.

Comment 2 Christian Krause 2011-10-24 19:24:05 UTC
I have investigated the issue: The problem is caused by a changed behavior of qt or its python bindings:

- if the plugin retrieves the content of an empty input field, the returned string was literally empty in F15 and previous releases but it contains now, beginning with F16, an html tag: "<br />"

- that's why the check for the emptiness of the input field fails and the plugin won't add any content

If have ask upstream for clarification.


In the meantime you can patch the downloaded plugin with this small patch:

--- .anki/plugins/chinese.py    2011-10-24 15:22:21.862139207 -0400
+++ chinese.py     2011-10-24 15:22:02.815014665 -0400
@@ -177,7 +177,7 @@
     else:
         return
     try:
-        if fact[dstField]:
+        if (fact[dstField] and fact[dstField] != "<br />"):
             return
     except:
         return

Comment 3 Christian Krause 2011-10-31 16:24:58 UTC
I have sent all my findings and the patch to the upstream developer. Since there is nothing more which can be done from a packaging perspective, I'm closing this bug report.