don't remove temporarily inaccesible decks

This commit is contained in:
Damien Elmes 2009-09-26 05:15:59 +09:00
parent 82081bd7c8
commit 1629c859d0

View file

@ -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()