mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 16:26:40 -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
|
continue
|
||||||
try:
|
try:
|
||||||
deck = DeckStorage.Deck(d, backup=False)
|
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:
|
except Exception, e:
|
||||||
if not "File is in use" in str(e):
|
if not "File is in use" in str(e):
|
||||||
toRemove.append(d)
|
toRemove.append(d)
|
||||||
else:
|
else:
|
||||||
|
print "ignoring", d
|
||||||
continue
|
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:
|
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