make question replaying a deck property; add exclude arg to play

This commit is contained in:
Damien Elmes 2012-07-04 18:18:54 +09:00
parent d47dfc1780
commit 5c8f45b2c4
3 changed files with 6 additions and 3 deletions

View file

@ -33,7 +33,6 @@ defaultConf = {
'sortType': "noteFld", 'sortType': "noteFld",
'sortBackwards': False, 'sortBackwards': False,
'addToCur': True, # add new to currently selected deck? 'addToCur': True, # add new to currently selected deck?
'replayBoth': True, # include question when replaying answer?
} }
# this is initialized by storage.Collection # this is initialized by storage.Collection

View file

@ -73,6 +73,7 @@ defaultConf = {
'maxTaken': 60, 'maxTaken': 60,
'timer': 0, 'timer': 0,
'autoplay': True, 'autoplay': True,
'replayq': True,
'mod': 0, 'mod': 0,
'usn': 0, 'usn': 0,
} }

View file

@ -10,9 +10,12 @@ from anki.utils import namedtmp, tmpdir, isWin, isMac
# Shared utils # Shared utils
########################################################################## ##########################################################################
def playFromText(text): def playFromText(text, exclude=""):
reg = "\[sound:(.*?)\]"
fnames = {} fnames = {}
for match in re.findall("\[sound:(.*?)\]", text): for match in re.findall(reg, exclude):
fnames[match] = True
for match in re.findall(reg, text):
if match in fnames: if match in fnames:
continue continue
fnames[match] = True fnames[match] = True