From a16bd9434122e13c6ff0ade866eb450d2bb0f5fb Mon Sep 17 00:00:00 2001 From: Sudarshan Gaikaiwari Date: Wed, 21 Feb 2018 07:16:52 -0600 Subject: [PATCH] Expose Anki sync via AnkiConnect --- AnkiConnect.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/AnkiConnect.py b/AnkiConnect.py index e9cabcd..5280dd4 100644 --- a/AnkiConnect.py +++ b/AnkiConnect.py @@ -947,10 +947,14 @@ class AnkiBridge: timer.timeout.connect(exitAnki) timer.start(1000) # 1s should be enough to allow the response to be sent. + def sync(self): + self.window()._sync() + # # AnkiConnect # + class AnkiConnect: def __init__(self): self.anki = AnkiBridge() @@ -1281,6 +1285,11 @@ class AnkiConnect: def notesInfo(self, notes): return self.anki.notesInfo(notes) + @webApi() + def sync(self): + return self.anki.sync() + + # # Entry #