From a702e03df068841fc1485412bf2f735ae3e2fc87 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 15 Mar 2011 07:09:40 +0900 Subject: [PATCH] add an option to disable the lock --- anki/storage.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/anki/storage.py b/anki/storage.py index f4f1fe68d..bfea272bf 100644 --- a/anki/storage.py +++ b/anki/storage.py @@ -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