mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-28 08:04:13 +08:00
Update ankiconnect.py
This commit is contained in:
parent
0f25577411
commit
b2396f109f
@ -91,22 +91,14 @@ class Card:
|
||||
class Model:
|
||||
@staticmethod
|
||||
def create(modelName, inOrderFields: list, css, isCloze, cardTemplates):
|
||||
try:
|
||||
print(
|
||||
invoke(
|
||||
"createModel",
|
||||
modelName=modelName,
|
||||
inOrderFields=inOrderFields,
|
||||
css=css,
|
||||
isCloze=isCloze,
|
||||
cardTemplates=cardTemplates,
|
||||
)
|
||||
)
|
||||
except AnkiException as e:
|
||||
if str(e) == "Model name already exists":
|
||||
pass
|
||||
else:
|
||||
raise e
|
||||
invoke(
|
||||
"createModel",
|
||||
modelName=modelName,
|
||||
inOrderFields=inOrderFields,
|
||||
css=css,
|
||||
isCloze=isCloze,
|
||||
cardTemplates=cardTemplates,
|
||||
)
|
||||
return Model(modelName)
|
||||
|
||||
def __init__(self, name):
|
||||
|
Loading…
x
Reference in New Issue
Block a user