diff --git a/pylib/anki/consts.py b/pylib/anki/consts.py index e8625d07e..778e44d87 100644 --- a/pylib/anki/consts.py +++ b/pylib/anki/consts.py @@ -66,6 +66,7 @@ LEECH_TAGONLY = 1 # Buttons BUTTON_ONE = 1 BUTTON_TWO = 2 +BUTTON_THREE = 3 # Labels ########################################################################## diff --git a/pylib/anki/sched.py b/pylib/anki/sched.py index f2428b07c..5ad5ecf82 100644 --- a/pylib/anki/sched.py +++ b/pylib/anki/sched.py @@ -565,7 +565,7 @@ did = ? and queue = 3 and due <= ? limit ?""", # lrnCount was decremented once when card was fetched lastLeft = card.left # immediate graduate? - if ease == 3: + if ease == BUTTON_THREE: self._rescheduleAsRev(card, conf, True) leaving = True # graduation time? @@ -971,7 +971,7 @@ select id from cards where did in %s and queue = 2 and due <= ? limit ?)""" ) if ease == BUTTON_TWO: interval = ivl2 - elif ease == 3: + elif ease == BUTTON_THREE: interval = ivl3 elif ease == 4: interval = ivl4 @@ -1367,7 +1367,7 @@ To study outside of the normal schedule, click the Custom Study button below.""" if ease == BUTTON_ONE: # fail return self._delayForGrade(conf, len(conf["delays"])) - elif ease == 3: + elif ease == BUTTON_THREE: # early removal if not self._resched(card): return 0 diff --git a/pylib/anki/schedv2.py b/pylib/anki/schedv2.py index 8b9885e90..e0a8dd2dc 100644 --- a/pylib/anki/schedv2.py +++ b/pylib/anki/schedv2.py @@ -621,7 +621,7 @@ did = ? and queue = {QUEUE_TYPE_DAY_LEARN_RELEARN} and due <= ? limit ?""", self._rescheduleAsRev(card, conf, True) leaving = True # next step? - elif ease == 3: + elif ease == BUTTON_THREE: # graduation time? if (card.left % 1000) - 1 <= 0: self._rescheduleAsRev(card, conf, False) @@ -1052,7 +1052,7 @@ select id from cards where did in %s and queue = 2 and due <= ? limit ?)""" return ivl2 ivl3 = self._constrainedIvl((card.ivl + delay // 2) * fct, conf, ivl2, fuzz) - if ease == 3: + if ease == BUTTON_THREE: return ivl3 ivl4 = self._constrainedIvl( @@ -1119,7 +1119,7 @@ select id from cards where did in %s and queue = 2 and due <= ? limit ?)""" # hard cards shouldn't have their interval decreased by more than 50% # of the normal factor minNewIvl = factor / 2 - elif ease == 3: + elif ease == BUTTON_THREE: factor = card.factor / 1000 else: # ease == 4: factor = card.factor / 1000 @@ -1591,7 +1591,7 @@ To study outside of the normal schedule, click the Custom Study button below.""" return self._delayForRepeatingGrade(conf, card.left) elif ease == 4: return self._graduatingIvl(card, conf, True, fuzz=False) * 86400 - else: # ease == 3 + else: # ease == BUTTON_THREE left = card.left % 1000 - 1 if left <= 0: # graduate