mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00
tablify info
This commit is contained in:
parent
5dc418060e
commit
fba161d0b1
1 changed files with 29 additions and 18 deletions
|
@ -147,10 +147,11 @@ table * { font-size: 14px; }
|
||||||
return txt
|
return txt
|
||||||
|
|
||||||
def _dueInfo(self, tot, num):
|
def _dueInfo(self, tot, num):
|
||||||
txt = _("Total: <b>%s reviews</b>") % tot
|
i = []
|
||||||
txt += "<br>" + _("Average: <b>%s</b>") % self._avgDay(
|
self._line(i, _("Total"), _("%d reviews") % tot)
|
||||||
tot, num, _("reviews"))
|
self._line(i, _("Average"), self._avgDay(
|
||||||
return txt
|
tot, num, _("reviews")))
|
||||||
|
return self._lineTbl(i)
|
||||||
|
|
||||||
def _due(self, start=None, end=None, chunk=1):
|
def _due(self, start=None, end=None, chunk=1):
|
||||||
lim = ""
|
lim = ""
|
||||||
|
@ -234,22 +235,25 @@ group by day order by day""" % (self._limit(), lim),
|
||||||
period = self._periodDays()
|
period = self._periodDays()
|
||||||
if not period:
|
if not period:
|
||||||
period = first
|
period = first
|
||||||
txt = _("Days studied: <b>%(pct)d%%</b> (%(x)s of %(y)s)") % dict(
|
i = []
|
||||||
x=studied, y=period, pct=studied/float(period)*100)
|
self._line(i, _("Days studied"),
|
||||||
|
_("<b>%(pct)d%%</b> (%(x)s of %(y)s)") % dict(
|
||||||
|
x=studied, y=period, pct=studied/float(period)*100),
|
||||||
|
bold=False)
|
||||||
if convHours:
|
if convHours:
|
||||||
tunit = _("hours")
|
tunit = _("hours")
|
||||||
else:
|
else:
|
||||||
tunit = unit
|
tunit = unit
|
||||||
txt += "<br>"+_("Total: <b>%(tot)s %(unit)s</b>") % dict(
|
self._line(i, _("Total"), _("%(tot)s %(unit)s") % dict(
|
||||||
unit=tunit, tot=int(tot))
|
unit=tunit, tot=int(tot)))
|
||||||
if convHours:
|
if convHours:
|
||||||
# convert to minutes
|
# convert to minutes
|
||||||
tot *= 60
|
tot *= 60
|
||||||
txt += "<br>"+_("Average over studied: <b>%s</b>") % self._avgDay(
|
self._line(i, _("Average over studied"), self._avgDay(
|
||||||
tot, studied, unit)
|
tot, studied, unit))
|
||||||
txt += "<br>"+_("If you studied every day: <b>%s</b>") % self._avgDay(
|
self._line(i, _("If you studied every day"), self._avgDay(
|
||||||
tot, period, unit)
|
tot, period, unit))
|
||||||
return txt
|
return self._lineTbl(i)
|
||||||
|
|
||||||
def _splitRepData(self, data, spec):
|
def _splitRepData(self, data, spec):
|
||||||
sep = {}
|
sep = {}
|
||||||
|
@ -356,9 +360,10 @@ group by day order by day)""" % lim,
|
||||||
bars={'show': False}, lines=dict(show=True), stack=False)
|
bars={'show': False}, lines=dict(show=True), stack=False)
|
||||||
], conf=dict(
|
], conf=dict(
|
||||||
yaxes=[dict(), dict(position="right", max=105)]))
|
yaxes=[dict(), dict(position="right", max=105)]))
|
||||||
txt += _("Average interval: <b>%s</b>") % fmtTimeSpan(avg*86400)
|
i = []
|
||||||
txt += "<br>" + _("Longest interval: <b>%s</b>") % fmtTimeSpan(max*86400)
|
self._line(i, _("Average interval"), fmtTimeSpan(avg*86400))
|
||||||
return txt
|
self._line(i, _("Longest interval"), fmtTimeSpan(max*86400))
|
||||||
|
return txt + self._lineTbl(i)
|
||||||
|
|
||||||
def _ivls(self):
|
def _ivls(self):
|
||||||
if self.type == 0:
|
if self.type == 0:
|
||||||
|
@ -486,8 +491,14 @@ when you answer "good" on a review.''')
|
||||||
info)
|
info)
|
||||||
return txt
|
return txt
|
||||||
|
|
||||||
def _line(self, i, a, b):
|
def _line(self, i, a, b, bold=True):
|
||||||
i.append(("<tr><td>%s:</td><td>%s</td></tr>") % (a,b))
|
if bold:
|
||||||
|
i.append(("<tr><td width=150 align=right>%s:</td><td><b>%s</b></td></tr>") % (a,b))
|
||||||
|
else:
|
||||||
|
i.append(("<tr><td width=150 align=right>%s:</td><td>%s</td></tr>") % (a,b))
|
||||||
|
|
||||||
|
def _lineTbl(self, i):
|
||||||
|
return "<table width=300>" + "".join(i) + "</table>"
|
||||||
|
|
||||||
def _factors(self):
|
def _factors(self):
|
||||||
return self.deck.db.first("""
|
return self.deck.db.first("""
|
||||||
|
|
Loading…
Reference in a new issue