# HG changeset patch # User Oleksandr Gavenko # Date 1474662455 -10800 # Node ID 5478477ab2aeea36b3779f575ed05d50685dcfe2 # Parent cfb780532bc12c90af76df91ec639bfd3314a964 Add related words to Anki cards. Break line if any reference is provided. diff -r cfb780532bc1 -r 5478477ab2ae py/gadict_srs_anki.py --- a/py/gadict_srs_anki.py Thu Sep 22 21:14:42 2016 +0300 +++ b/py/gadict_srs_anki.py Fri Sep 23 23:27:35 2016 +0300 @@ -167,16 +167,24 @@ buf.append("") buf.append(sense.pos) buf.append("") + have_ref = False if sense.ant_list and len(sense.ant_list) > 0: + have_ref = True buf.append(" ant: ") buf.append("; ".join(sense.ant_list)) buf.append("") if sense.syn_list and len(sense.syn_list) > 0: + have_ref = True buf.append(" syn: ") buf.append("; ".join(sense.syn_list)) buf.append("") + if sense.rel_list and len(sense.rel_list) > 0: + have_ref = True + buf.append(" rel: ") + buf.append("; ".join(sense.rel_list)) + buf.append("") for (lang, tr) in sense.tr_list or []: - if len(sense.tr_list) > 1: + if len(sense.tr_list) > 1 or have_ref: buf.append("
") buf.append(" ") buf.append(lang) @@ -184,7 +192,7 @@ buf.append(" ") buf.append(tr) buf.append("") - if len(sense.tr_list) > 1: + if len(sense.tr_list) > 1 or have_ref: buf.append("
") for (lang, tr) in sense.glos_list or []: buf.append("
")