minor cleanup

This commit is contained in:
Alex Yatskov 2019-03-07 10:19:35 -08:00
parent 77a558fc31
commit ee7b158cc9
2 changed files with 6 additions and 7 deletions

View File

@ -520,7 +520,7 @@ class AnkiConnect:
self.window().unloadProfileAndShowProfileManager() self.window().unloadProfileAndShowProfileManager()
self.loadProfile(name) self.loadProfile(name)
return True return True
@api() @api()
def sync(self): def sync(self):
@ -716,7 +716,7 @@ class AnkiConnect:
for field in audio['fields']: for field in audio['fields']:
if field in ankiNote: if field in ankiNote:
ankiNote[field] += u'[sound:{}]'.format(audioFilename) ankiNote[field] += u'[sound:{}]'.format(audioFilename)
except Exception as e: except Exception as e:
errorMessage = str(e).replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;") errorMessage = str(e).replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;")
for field in audio['fields']: for field in audio['fields']:
@ -869,7 +869,7 @@ class AnkiConnect:
for field in inOrderFields: for field in inOrderFields:
fm = mm.newField(_(field)) fm = mm.newField(_(field))
mm.addField(m, fm) mm.addField(m, fm)
# Add shared css to model if exists. Use default otherwise # Add shared css to model if exists. Use default otherwise
if (css is not None): if (css is not None):
m['css'] = css m['css'] = css

View File

@ -728,10 +728,10 @@ guarantee that your application continues to function properly in the future.
``` ```
**Create new Model** **Create New Model**
Creates a new model to be used in Anki. User must provide modelName, inOrderFields and cardTemplates to be used Creates a new model to be used in Anki. User must provide the `modelName`, `inOrderFields` and `cardTemplates` to be
in the model. used in the model.
*Sample request* *Sample request*
```json ```json
@ -821,7 +821,6 @@ guarantee that your application continues to function properly in the future.
} }
``` ```
#### Notes #### #### Notes ####
* **addNote** * **addNote**