update finished screen to use blanket inactive/suspended msg

This commit is contained in:
Damien Elmes 2010-12-26 07:29:31 +09:00
parent 856839e055
commit 9890c77514

View file

@ -1171,27 +1171,12 @@ and type between 0 and 1""", time=time)
spaceSusp += ngettext( spaceSusp += ngettext(
'There is <b>%d delayed</b> card.', 'There is <b>%d delayed</b> card.',
'There are <b>%d delayed</b> cards.', c) % c 'There are <b>%d delayed</b> cards.', c) % c
c2 = self.suspendedCardCount() c2 = self.hiddenCards()
if c2: if c2:
if spaceSusp: if spaceSusp:
spaceSusp += "<br>" spaceSusp += "<br>"
spaceSusp += ngettext('There is %d suspended card.', spaceSusp += _(
'There are %d suspended cards.', "Some cards are inactive or suspended.")
c2) % c2
# c3 = self.inactiveCardCount()
# if c3:
# if spaceSusp:
# spaceSusp += "<br>"
# spaceSusp += ngettext('There is %d inactive card.',
# 'There are %d inactive cards.',
# c3) % c3
c4 = self.leechCardCount()
if c4:
if spaceSusp:
spaceSusp += "<br>"
spaceSusp += ngettext('There is %d leech.',
'There are %d leeches.',
c4) % c4
if spaceSusp: if spaceSusp:
spaceSusp = "<br><br>" + spaceSusp spaceSusp = "<br><br>" + spaceSusp
return _('''\ return _('''\
@ -1319,12 +1304,13 @@ where type < 0 and id in %s""" %
card.isDue = 0 card.isDue = 0
self.flushMod() 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(""" 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): def leechCardCount(self):
return len(self.findCards("is:suspended tag:leech")) return len(self.findCards("is:suspended tag:leech"))
@ -1333,9 +1319,6 @@ select count(id) from cards where type < 0""")
return self.s.scalar( return self.s.scalar(
"select count(id) from cards where type != 2") "select count(id) from cards where type != 2")
# Counts related to due cards
##########################################################################
def newCardsDoneToday(self): def newCardsDoneToday(self):
return (self._dailyStats.newEase0 + return (self._dailyStats.newEase0 +
self._dailyStats.newEase1 + self._dailyStats.newEase1 +