mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
remove obsolete time span pair code
This commit is contained in:
parent
c90828349c
commit
9172c9b697
1 changed files with 0 additions and 18 deletions
|
@ -70,24 +70,6 @@ def fmtTimeSpan(time, pad=0, point=0, short=False, after=False):
|
|||
timestr = "%(a)d.%(b)df" % {'a': pad, 'b': point}
|
||||
return locale.format_string("%" + (fmt % timestr), time)
|
||||
|
||||
def fmtTimeSpanPair(time1, time2, short=False, after=False):
|
||||
(type, point) = optimalPeriod(time1, 0)
|
||||
time1 = convertSecondsTo(time1, type)
|
||||
time2 = convertSecondsTo(time2, type)
|
||||
# a pair is always should always be read as plural
|
||||
if short:
|
||||
fmt = shortTimeTable[type]
|
||||
else:
|
||||
if after:
|
||||
fmt = afterTimeTable[type](2)
|
||||
else:
|
||||
fmt = timeTable[type](2)
|
||||
timestr = "%(a)d.%(b)df" % {'a': pad, 'b': point}
|
||||
finalstr = "%s-%s" % (
|
||||
locale.format_string('%' + timestr, time1),
|
||||
locale.format_string('%' + timestr, time2),)
|
||||
return fmt % finalstr
|
||||
|
||||
def optimalPeriod(time, point):
|
||||
if abs(time) < 60:
|
||||
type = "seconds"
|
||||
|
|
Loading…
Reference in a new issue