mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00

- make sure we set a timestamp due time, and put the card back in the queue - add a unit test for it
48 lines
1.1 KiB
Python
48 lines
1.1 KiB
Python
# -*- coding: utf-8 -*-
|
|
# Copyright: Damien Elmes <anki@ichi2.net>
|
|
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
|
|
|
import simplejson
|
|
from anki.utils import intTime
|
|
|
|
defaultConf = {
|
|
'new': {
|
|
'delays': [0.5, 3, 10],
|
|
'ints': [1, 7, 4],
|
|
'initialFactor': 2.5,
|
|
},
|
|
'lapse': {
|
|
'delays': [0.5, 3, 10],
|
|
'mult': 0,
|
|
'relearn': True,
|
|
'leechFails': 16,
|
|
# one of [suspend], [tagonly]
|
|
'leechAction': ["suspend"],
|
|
},
|
|
'cram': {
|
|
'delays': [0.5, 3, 10],
|
|
'resched': True,
|
|
'reset': True,
|
|
'mult': 0,
|
|
},
|
|
'rev': {
|
|
'ease4': 1.3,
|
|
'fuzz': 0.05,
|
|
'minSpace': 1,
|
|
},
|
|
'maxTaken': 60,
|
|
}
|
|
|
|
class GroupConfig(object):
|
|
def __init__(self, name):
|
|
self.name = name
|
|
self.id = None
|
|
self.config = defaultConf
|
|
|
|
def load(self):
|
|
self.config = simplejson.loads(self._config)
|
|
return self
|
|
|
|
def save(self):
|
|
self._config = simplejson.dumps(self.config)
|
|
self.modified = intTime()
|