mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
add an option to disable the lock
This commit is contained in:
parent
945e5e9da8
commit
a702e03df0
1 changed files with 3 additions and 2 deletions
|
@ -12,7 +12,7 @@ from anki.deck import _Deck
|
|||
from anki.stdmodels import BasicModel
|
||||
from anki.errors import AnkiError
|
||||
|
||||
def Deck(path, queue=True):
|
||||
def Deck(path, queue=True, lock=True):
|
||||
"Open a new or existing deck. Path must be unicode."
|
||||
path = os.path.abspath(path)
|
||||
create = not os.path.exists(path)
|
||||
|
@ -34,7 +34,8 @@ def Deck(path, queue=True):
|
|||
elif create:
|
||||
deck.addModel(BasicModel(deck))
|
||||
deck.save()
|
||||
deck.lock()
|
||||
if lock:
|
||||
deck.lock()
|
||||
if not queue:
|
||||
return deck
|
||||
# rebuild queue
|
||||
|
|
Loading…
Reference in a new issue