preserve order in multi cloze type answer; bump version

This commit is contained in:
Damien Elmes 2014-01-30 00:34:42 +09:00
parent e963576e21
commit 3b20de173f
2 changed files with 9 additions and 2 deletions

View file

@ -30,6 +30,6 @@ if arch[1] == "ELF":
sys.path.insert(0, os.path.join(ext, "py2.%d-%s" % ( sys.path.insert(0, os.path.join(ext, "py2.%d-%s" % (
sys.version_info[1], arch[0][0:2]))) sys.version_info[1], arch[0][0:2])))
version="2.0.21" # build scripts grep this line, so preserve formatting version="2.0.22" # build scripts grep this line, so preserve formatting
from anki.storage import Collection from anki.storage import Collection
__all__ = ["Collection"] __all__ = ["Collection"]

View file

@ -434,7 +434,14 @@ Please run Tools>Empty Cards""")
return txt return txt
matches = [noHint(txt) for txt in matches] matches = [noHint(txt) for txt in matches]
if len(matches) > 1: if len(matches) > 1:
txt = ", ".join(list(set(matches))) arr = []
seen = {}
for m in matches:
if m in seen:
continue
seen[m] = 1
arr.append(m)
txt = ", ".join(arr)
else: else:
txt = matches[0] txt = matches[0]
return txt return txt