BUTTON_ONE

This commit is contained in:
Arthur Milchior 2020-01-30 17:05:51 -08:00
parent be148ce8a1
commit 5104cac97f
3 changed files with 9 additions and 8 deletions

View File

@ -64,6 +64,7 @@ LEECH_SUSPEND = 0
LEECH_TAGONLY = 1 LEECH_TAGONLY = 1
# Buttons # Buttons
BUTTON_ONE = 1
# Labels # Labels
########################################################################## ##########################################################################

View File

@ -874,7 +874,7 @@ select id from cards where did in %s and queue = 2 and due <= ? limit ?)"""
def _answerRevCard(self, card, ease): def _answerRevCard(self, card, ease):
delay = 0 delay = 0
if ease == 1: if ease == BUTTON_ONE:
delay = self._rescheduleLapse(card) delay = self._rescheduleLapse(card)
else: else:
self._rescheduleRev(card, ease) self._rescheduleRev(card, ease)
@ -1349,7 +1349,7 @@ To study outside of the normal schedule, click the Custom Study button below."""
"Return the next interval for CARD, in seconds." "Return the next interval for CARD, in seconds."
if card.queue in (0, 1, 3): if card.queue in (0, 1, 3):
return self._nextLrnIvl(card, ease) return self._nextLrnIvl(card, ease)
elif ease == 1: elif ease == BUTTON_ONE:
# lapsed # lapsed
conf = self._lapseConf(card) conf = self._lapseConf(card)
if conf["delays"]: if conf["delays"]:
@ -1364,7 +1364,7 @@ To study outside of the normal schedule, click the Custom Study button below."""
if card.queue == 0: if card.queue == 0:
card.left = self._startingLeft(card) card.left = self._startingLeft(card)
conf = self._lrnConf(card) conf = self._lrnConf(card)
if ease == 1: if ease == BUTTON_ONE:
# fail # fail
return self._delayForGrade(conf, len(conf["delays"])) return self._delayForGrade(conf, len(conf["delays"]))
elif ease == 3: elif ease == 3:

View File

@ -121,7 +121,7 @@ class Scheduler:
def _answerCardPreview(self, card: Card, ease: int) -> None: def _answerCardPreview(self, card: Card, ease: int) -> None:
assert 1 <= ease <= 2 assert 1 <= ease <= 2
if ease == 1: if ease == BUTTON_ONE:
# repeat after delay # repeat after delay
card.queue = QUEUE_TYPE_PREVIEW card.queue = QUEUE_TYPE_PREVIEW
card.due = intTime() + self._previewDelay(card) card.due = intTime() + self._previewDelay(card)
@ -962,7 +962,7 @@ select id from cards where did in %s and queue = 2 and due <= ? limit ?)"""
early = bool(card.odid and (card.odue > self.today)) early = bool(card.odid and (card.odue > self.today))
type = early and 3 or 1 type = early and 3 or 1
if ease == 1: if ease == BUTTON_ONE:
delay = self._rescheduleLapse(card) delay = self._rescheduleLapse(card)
else: else:
self._rescheduleRev(card, ease, early) self._rescheduleRev(card, ease, early)
@ -1557,14 +1557,14 @@ To study outside of the normal schedule, click the Custom Study button below."""
"Return the next interval for CARD, in seconds." "Return the next interval for CARD, in seconds."
# preview mode? # preview mode?
if self._previewingCard(card): if self._previewingCard(card):
if ease == 1: if ease == BUTTON_ONE:
return self._previewDelay(card) return self._previewDelay(card)
return 0 return 0
# (re)learning? # (re)learning?
if card.queue in (0, 1, QUEUE_TYPE_DAY_LEARN_RELEARN): if card.queue in (0, 1, QUEUE_TYPE_DAY_LEARN_RELEARN):
return self._nextLrnIvl(card, ease) return self._nextLrnIvl(card, ease)
elif ease == 1: elif ease == BUTTON_ONE:
# lapse # lapse
conf = self._lapseConf(card) conf = self._lapseConf(card)
if conf["delays"]: if conf["delays"]:
@ -1583,7 +1583,7 @@ To study outside of the normal schedule, click the Custom Study button below."""
if card.queue == 0: if card.queue == 0:
card.left = self._startingLeft(card) card.left = self._startingLeft(card)
conf = self._lrnConf(card) conf = self._lrnConf(card)
if ease == 1: if ease == BUTTON_ONE:
# fail # fail
return self._delayForGrade(conf, len(conf["delays"])) return self._delayForGrade(conf, len(conf["delays"]))
elif ease == 2: elif ease == 2: