From 3c269d5fba028677ab03ace89b7d41f9cd149da1 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 17 Apr 2011 05:33:00 +0900 Subject: [PATCH] sticky fields; add forget option to leeches --- anki/groups.py | 2 +- anki/models.py | 1 + anki/sched.py | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/anki/groups.py b/anki/groups.py index bac8aab46..22798f6f5 100644 --- a/anki/groups.py +++ b/anki/groups.py @@ -17,7 +17,7 @@ defaultConf = { 'minInt': 1, 'relearn': True, 'leechFails': 16, - # [type, data], where type 0=suspend, 1=tagonly + # [type, data], where type 0=suspend, 1=tagonly, 2=forget 'leechAction': [0], }, 'cram': { diff --git a/anki/models.py b/anki/models.py index 1503a672b..bb0b99a1a 100644 --- a/anki/models.py +++ b/anki/models.py @@ -26,6 +26,7 @@ defaultField = { 'esize': 20, 'qcol': "#000", 'pre': True, + 'sticky': False, } defaultTemplate = { diff --git a/anki/sched.py b/anki/sched.py index 33d786496..5f0185caf 100644 --- a/anki/sched.py +++ b/anki/sched.py @@ -542,9 +542,13 @@ queue = 2 %s and due <= :lim order by %s limit %d""" % ( f.addTag("leech") f.flush() # handle - if conf['leechAction'][0] == 0: + a = conf['leechAction'][0] + if a == 0: self.suspendCards([card.id]) card.queue = -1 + elif a == 2: + self.resetCards([card.id]) + card.due = 1000000 # notify UI runHook("leech", card)