Merge branch 'master' of github.com:dae/libanki

This commit is contained in:
Damien Elmes 2012-05-04 22:55:04 +09:00
commit 2433da7ef5

View file

@ -264,10 +264,10 @@ select id from cards where nid in (select id from notes where mid = ?)""",
def renameField(self, m, field, newName):
self.col.modSchema()
pat = "({{|[:#^/])%s(}})"
pat = r'{{([:#^/]|[^:#/^}][^:}]*?:|)%s}}'
def wrap(txt):
def repl(match):
return match.group(1) + txt + match.group(2)
return '{{' + match.group(1) + txt + '}}'
return repl
for t in m['tmpls']:
for fmt in ('qfmt', 'afmt'):