Update ankiconnect.py

This commit is contained in:
恍兮惚兮 2024-08-07 23:58:43 +08:00
parent 0f25577411
commit b2396f109f

View File

@ -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):