minor cleanup
This commit is contained in:
parent
77a558fc31
commit
ee7b158cc9
@ -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("&", "&").replace("<", "<").replace(">", ">")
|
errorMessage = str(e).replace("&", "&").replace("<", "<").replace(">", ">")
|
||||||
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
|
||||||
|
@ -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**
|
||||||
|
Loading…
Reference in New Issue
Block a user