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