mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
Reverting "suspend/unsuspend noweb on full sync"; obsolete
This commit is contained in:
parent
358b453906
commit
f96a7a7c5b
1 changed files with 0 additions and 16 deletions
16
anki/sync.py
16
anki/sync.py
|
@ -35,7 +35,6 @@ from anki.media import checksum
|
|||
from anki.utils import ids2str, hexifyID
|
||||
from anki.lang import _
|
||||
from hooks import runHook
|
||||
from anki import DeckStorage
|
||||
|
||||
if simplejson.__version__ < "1.7.3":
|
||||
raise "SimpleJSON must be 1.7.3 or later."
|
||||
|
@ -976,23 +975,9 @@ and cards.id in %s""" % ids2str([c[0] for c in cards])))
|
|||
else:
|
||||
self.fullSyncFromServer(ret[1], ret[2])
|
||||
|
||||
def resetNoWeb(self, path, suspend):
|
||||
if suspend:
|
||||
suspend = ["noweb"]
|
||||
else:
|
||||
suspend = []
|
||||
d = DeckStorage.Deck(path, backup=False)
|
||||
ids = d.findCards("tag:noweb")
|
||||
if not suspend:
|
||||
d.updateTagPriorities()
|
||||
d.updatePriorities(ids, suspend=suspend, dirty=False)
|
||||
d.s.commit()
|
||||
d.close()
|
||||
|
||||
def fullSyncFromLocal(self, fields, path):
|
||||
global sendProgressHook
|
||||
try:
|
||||
self.resetNoWeb(path, suspend=True)
|
||||
# write into a temporary file, since POST needs content-length
|
||||
src = open(path, "rb")
|
||||
(fd, name) = tempfile.mkstemp(prefix="anki")
|
||||
|
@ -1064,7 +1049,6 @@ and cards.id in %s""" % ids2str([c[0] for c in cards])))
|
|||
# if we were successful, overwrite old deck
|
||||
os.unlink(path)
|
||||
os.rename(tmpname, path)
|
||||
self.resetNoWeb(path, suspend=False)
|
||||
finally:
|
||||
runHook("fullSyncFinished")
|
||||
|
||||
|
|
Loading…
Reference in a new issue