From 1e9833ab2ae42fb4befda7f20dbc57e21f1ebdef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Pokorn=C3=BD=20=28Rai=29?= Date: Mon, 23 Dec 2019 00:25:56 +0100 Subject: [PATCH] Whitespace reformat to force 80-character line limit --- anki/collection.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/anki/collection.py b/anki/collection.py index cd5933c35..4793eae68 100644 --- a/anki/collection.py +++ b/anki/collection.py @@ -575,8 +575,7 @@ where c.nid = n.id and c.id in %s group by nid""" % ids2str(cids)): where = "" else: raise Exception() - return [self._renderQA(row) - for row in self._qaData(where)] + return [self._renderQA(*row) for row in self._qaData(where)] def _renderQA(self, data: Tuple[int,int,int,int,int,str,str,int], qfmt: None = None, afmt: None = None) -> Dict: "Returns hash of id, question, answer." @@ -605,13 +604,14 @@ where c.nid = n.id and c.id in %s group by nid""" % ids2str(cids)): afmt = afmt or template['afmt'] for (type, format) in (("q", qfmt), ("a", afmt)): if type == "q": - format = re.sub("{{(?!type:)(.*?)cloze:", r"{{\1cq-%d:" % (data[4]+1), format) - format = format.replace("<%cloze:", "<%%cq:%d:" % ( - data[4]+1)) + format = re.sub("{{(?!type:)(.*?)cloze:", + r"{{\1cq-%d:" % (data[4]+1), format) + format = format.replace("<%cloze:", "<%%cq:%d:" % (data[4]+1)) else: - format = re.sub("{{(.*?)cloze:", r"{{\1ca-%d:" % (data[4]+1), format) - format = format.replace("<%cloze:", "<%%ca:%d:" % ( - data[4]+1)) + format = re.sub( + "{{(.*?)cloze:", r"{{\1ca-%d:" % (data[4]+1), format) + format = format.replace( + "<%cloze:", "<%%ca:%d:" % (data[4]+1)) fields['FrontSide'] = stripSounds(d['q']) fields = runFilter("mungeFields", fields, model, data, self) html = anki.template.render(format, fields)