mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
more tweaks
This commit is contained in:
parent
799b322e12
commit
d6258e7231
1 changed files with 6 additions and 8 deletions
|
@ -20,7 +20,7 @@ class CardStats(object):
|
||||||
|
|
||||||
def report(self):
|
def report(self):
|
||||||
c = self.card
|
c = self.card
|
||||||
fmt = fmtTimeSpan
|
fmt = lambda x, **kwargs: fmtTimeSpan(x, short=True, **kwargs)
|
||||||
self.txt = "<table width=100%%>"
|
self.txt = "<table width=100%%>"
|
||||||
self.addLine(_("Added"), self.strTime(c.crt))
|
self.addLine(_("Added"), self.strTime(c.crt))
|
||||||
first = self.deck.db.scalar(
|
first = self.deck.db.scalar(
|
||||||
|
@ -30,16 +30,13 @@ class CardStats(object):
|
||||||
self.addLine(_("Changed"), self.strTime(c.mod))
|
self.addLine(_("Changed"), self.strTime(c.mod))
|
||||||
if c.reps:
|
if c.reps:
|
||||||
if c.queue == 2:
|
if c.queue == 2:
|
||||||
next = (self.deck.sched.today - c.due)*86400
|
next = time.time()+((self.deck.sched.today - c.due)*86400)
|
||||||
else:
|
else:
|
||||||
next = time.time() - c.due
|
next = c.due
|
||||||
if next > 0:
|
next = self.strTime(next)
|
||||||
next = _("%s ago") % fmt(next)
|
|
||||||
else:
|
|
||||||
next = _("in %s") % fmt(abs(next))
|
|
||||||
self.addLine(_("Due"), next)
|
self.addLine(_("Due"), next)
|
||||||
self.addLine(_("Interval"), fmt(c.ivl * 86400))
|
self.addLine(_("Interval"), fmt(c.ivl * 86400))
|
||||||
self.addLine(_("Ease"), fmtFloat(c.factor/1000.0, point=2))
|
self.addLine(_("Ease"), "%d%%" % (c.factor/10.0))
|
||||||
if c.reps:
|
if c.reps:
|
||||||
self.addLine(_("Reviews"), "%d/%d (s=%d)" % (
|
self.addLine(_("Reviews"), "%d/%d (s=%d)" % (
|
||||||
c.reps-c.lapses, c.reps, c.streak))
|
c.reps-c.lapses, c.reps, c.streak))
|
||||||
|
@ -60,6 +57,7 @@ class CardStats(object):
|
||||||
self.txt += "<b>%s</b></td><td>%s</td></tr>" % (k, v)
|
self.txt += "<b>%s</b></td><td>%s</td></tr>" % (k, v)
|
||||||
|
|
||||||
def strTime(self, tm):
|
def strTime(self, tm):
|
||||||
|
return time.strftime("%Y-%m-%d", time.localtime(tm))
|
||||||
s = anki.utils.fmtTimeSpan(time.time() - tm)
|
s = anki.utils.fmtTimeSpan(time.time() - tm)
|
||||||
return _("%s ago") % s
|
return _("%s ago") % s
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue