Add fast non-GUI browse function

This commit is contained in:
David Bailey 2017-07-21 01:50:12 +01:00
parent 5517473072
commit d9f94652b2

View File

@ -456,6 +456,13 @@ class AnkiBridge:
return browser.model.cards return browser.model.cards
def browse(self, query=None):
if query is not None:
return aqt.mw.col.findCards(query)
else:
return []
def guiAddCards(self): def guiAddCards(self):
addCards = aqt.dialogs.open('AddCards', self.window()) addCards = aqt.dialogs.open('AddCards', self.window())
addCards.activateWindow() addCards.activateWindow()
@ -676,6 +683,11 @@ class AnkiConnect:
return self.anki.guiBrowse(query) return self.anki.guiBrowse(query)
@webApi
def browse(self, query=None):
return self.anki.browse(query)
@webApi @webApi
def guiAddCards(self): def guiAddCards(self):
return self.anki.guiAddCards() return self.anki.guiAddCards()