Add fast non-GUI browse function
This commit is contained in:
parent
5517473072
commit
d9f94652b2
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user