From 9890c775146daab60b3fe2090dd034b52272158a Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 26 Dec 2010 07:29:31 +0900 Subject: [PATCH] update finished screen to use blanket inactive/suspended msg --- anki/deck.py | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/anki/deck.py b/anki/deck.py index eaa4e3708..4b541347a 100644 --- a/anki/deck.py +++ b/anki/deck.py @@ -1171,27 +1171,12 @@ and type between 0 and 1""", time=time) spaceSusp += ngettext( 'There is %d delayed card.', 'There are %d delayed cards.', c) % c - c2 = self.suspendedCardCount() + c2 = self.hiddenCards() if c2: if spaceSusp: spaceSusp += "
" - spaceSusp += ngettext('There is %d suspended card.', - 'There are %d suspended cards.', - c2) % c2 - # c3 = self.inactiveCardCount() - # if c3: - # if spaceSusp: - # spaceSusp += "
" - # spaceSusp += ngettext('There is %d inactive card.', - # 'There are %d inactive cards.', - # c3) % c3 - c4 = self.leechCardCount() - if c4: - if spaceSusp: - spaceSusp += "
" - spaceSusp += ngettext('There is %d leech.', - 'There are %d leeches.', - c4) % c4 + spaceSusp += _( + "Some cards are inactive or suspended.") if spaceSusp: spaceSusp = "

" + spaceSusp return _('''\ @@ -1319,12 +1304,13 @@ where type < 0 and id in %s""" % card.isDue = 0 self.flushMod() - # Card/fact counts - all in deck, not just due + # Counts ########################################################################## - def suspendedCardCount(self): + def hiddenCards(self): + "Assumes queue finished. True if some due cards have not been shown." return self.s.scalar(""" -select count(id) from cards where type < 0""") +select 1 from cards where combinedDue < :now limit 1""", now=self.dueCutoff) def leechCardCount(self): return len(self.findCards("is:suspended tag:leech")) @@ -1333,9 +1319,6 @@ select count(id) from cards where type < 0""") return self.s.scalar( "select count(id) from cards where type != 2") - # Counts related to due cards - ########################################################################## - def newCardsDoneToday(self): return (self._dailyStats.newEase0 + self._dailyStats.newEase1 +