mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
don't remove temporarily inaccesible decks
This commit is contained in:
parent
82081bd7c8
commit
1629c859d0
1 changed files with 3 additions and 5 deletions
|
@ -1063,7 +1063,6 @@ your deck."""))
|
||||||
self.updateProgress(_("Checking deck %(x)d of %(y)d...") % {
|
self.updateProgress(_("Checking deck %(x)d of %(y)d...") % {
|
||||||
'x': c+1, 'y': len(self.config['recentDeckPaths'])})
|
'x': c+1, 'y': len(self.config['recentDeckPaths'])})
|
||||||
if not os.path.exists(d):
|
if not os.path.exists(d):
|
||||||
toRemove.append(d)
|
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
deck = DeckStorage.Deck(d, backup=False)
|
deck = DeckStorage.Deck(d, backup=False)
|
||||||
|
@ -1078,11 +1077,10 @@ your deck."""))
|
||||||
})
|
})
|
||||||
deck.close()
|
deck.close()
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
if not "File is in use" in str(e):
|
if "File is in use" in str(e):
|
||||||
toRemove.append(d)
|
|
||||||
else:
|
|
||||||
print "ignoring", d
|
|
||||||
continue
|
continue
|
||||||
|
else:
|
||||||
|
toRemove.append(d)
|
||||||
for d in toRemove:
|
for d in toRemove:
|
||||||
self.config['recentDeckPaths'].remove(d)
|
self.config['recentDeckPaths'].remove(d)
|
||||||
self.config.save()
|
self.config.save()
|
||||||
|
|
Loading…
Reference in a new issue