From cd980ff5e02f3be9af990b02ac9bcd3d22cdf7f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mice=20P=C3=A1pai?= Date: Sun, 16 Feb 2020 20:19:10 +0100 Subject: [PATCH 1/2] fix shebang (universal), add link_mac.sh --- link.sh | 2 +- link_mac.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100755 link_mac.sh diff --git a/link.sh b/link.sh index 1e85c1f..9551068 100755 --- a/link.sh +++ b/link.sh @@ -1,2 +1,2 @@ -#!/usr/bin/bash +#!/usr/bin/env bash ln -s $(pwd)/plugin ~/.local/share/Anki2/addons21/AnkiConnectDev diff --git a/link_mac.sh b/link_mac.sh new file mode 100755 index 0000000..316966e --- /dev/null +++ b/link_mac.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +ln -s $(pwd)/plugin ~/Library/Application\ Support/Anki2/addons21/AnkiConnectDev From 59c84b91dbc1943ca1ea9565a66455d68f4d9f70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mice=20P=C3=A1pai?= Date: Sun, 16 Feb 2020 20:19:48 +0100 Subject: [PATCH 2/2] replace Card._getQA() with the new .answer() and .question() --- plugin/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin/__init__.py b/plugin/__init__.py index c8a18ff..79109a4 100644 --- a/plugin/__init__.py +++ b/plugin/__init__.py @@ -796,8 +796,8 @@ class AnkiConnect: 'cardId': card.id, 'fields': fields, 'fieldOrder': card.ord, - 'question': card._getQA()['q'], - 'answer': card._getQA()['a'], + 'question': card.question(), + 'answer': card.answer(), 'modelName': model['name'], 'deckName': self.deckNameFromId(card.did), 'css': model['css'], @@ -1042,8 +1042,8 @@ class AnkiConnect: 'cardId': card.id, 'fields': fields, 'fieldOrder': card.ord, - 'question': card._getQA()['q'], - 'answer': card._getQA()['a'], + 'question': card.question(), + 'answer': card.answer(), 'buttons': [b[0] for b in buttonList], 'nextReviews': [reviewer.mw.col.sched.nextIvlStr(reviewer.card, b[0], True) for b in buttonList], 'modelName': model['name'],