mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2025-01-01 10:04:12 +08:00
Update ankiconnect.py
This commit is contained in:
parent
0f25577411
commit
b2396f109f
@ -91,8 +91,6 @@ 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:
|
|
||||||
print(
|
|
||||||
invoke(
|
invoke(
|
||||||
"createModel",
|
"createModel",
|
||||||
modelName=modelName,
|
modelName=modelName,
|
||||||
@ -101,12 +99,6 @@ class Model:
|
|||||||
isCloze=isCloze,
|
isCloze=isCloze,
|
||||||
cardTemplates=cardTemplates,
|
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