Adding new APIs

This commit is contained in:
Alex Yatskov 2016-05-28 23:23:14 -07:00
parent a50f1b2077
commit 30d243790f

View File

@ -306,6 +306,27 @@ class AnkiConnect:
return self.anki.modelFieldNames(modelName)
def api_addNote(self, note):
return self.anki.addNote(
note['deckName'],
note['modelName'],
note['fields'],
note['tags']
)
def api_canAddNotes(self, notes):
results = []
for note in notes:
results.append(self.anki.canAddNote(
note['deckName'],
note['modelName'],
note['fields']
))
return results
def api_features(self):
features = {}
for name in dir(self):