From db602ebe9a0c2c6f56230f90ee436b6533d3f846 Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Sat, 4 May 2019 23:24:13 +0200 Subject: [PATCH] Add return values --- plugin/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugin/__init__.py b/plugin/__init__.py index c8a18ff..cfc3bf6 100644 --- a/plugin/__init__.py +++ b/plugin/__init__.py @@ -977,6 +977,8 @@ class AnkiConnect: aqt.dialogs.open(windowName, self.window()) addCards.setAndFocusNote(editor.note) + return ankiNote.id + elif note is not None: currentWindow = aqt.dialogs._dialogs['AddCards'][1] @@ -1011,10 +1013,14 @@ class AnkiConnect: else: openNewWindow() + return aqt.dialogs._dialogs['AddCards'][1].editor.note.id + else: addCards = aqt.dialogs.open('AddCards', self.window()) addCards.activateWindow() + return addCards.editor.note.id + @util.api() def guiReviewActive(self): return self.reviewer().card is not None and self.window().state == 'review'