mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 08:22:24 -04:00
do count check inside try block
This commit is contained in:
parent
09e8fe8e33
commit
50275c74f1
1 changed files with 9 additions and 8 deletions
|
@ -1014,19 +1014,20 @@ your deck."""))
|
|||
continue
|
||||
try:
|
||||
deck = DeckStorage.Deck(d, backup=False)
|
||||
self.browserDecks.append({
|
||||
'path': d,
|
||||
'name': deck.name(),
|
||||
'due': deck.failedSoonCount + deck.revCount,
|
||||
'new': deck.newCountToday,
|
||||
'mod': deck.modified,
|
||||
})
|
||||
deck.close()
|
||||
except Exception, e:
|
||||
if not "File is in use" in str(e):
|
||||
toRemove.append(d)
|
||||
else:
|
||||
print "ignoring", d
|
||||
continue
|
||||
self.browserDecks.append({
|
||||
'path': d,
|
||||
'name': deck.name(),
|
||||
'due': deck.failedSoonCount + deck.revCount,
|
||||
'new': deck.newCountToday,
|
||||
'mod': deck.modified,
|
||||
})
|
||||
deck.close()
|
||||
for d in toRemove:
|
||||
self.config['recentDeckPaths'].remove(d)
|
||||
self.config.save()
|
||||
|
|
Loading…
Reference in a new issue