mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 16:26:40 -04:00
more raw string literals
This commit is contained in:
parent
435afed325
commit
7981db1466
2 changed files with 4 additions and 4 deletions
|
@ -1350,7 +1350,7 @@ where id in %s""" % ids2str(sf))
|
||||||
if self._previewState == "answer":
|
if self._previewState == "answer":
|
||||||
func = "_showAnswer"
|
func = "_showAnswer"
|
||||||
txt = c.a()
|
txt = c.a()
|
||||||
txt = re.sub("\[\[type:[^]]+\]\]", "", txt)
|
txt = re.sub(r"\[\[type:[^]]+\]\]", "", txt)
|
||||||
|
|
||||||
bodyclass = bodyClass(self.mw.col, c)
|
bodyclass = bodyClass(self.mw.col, c)
|
||||||
|
|
||||||
|
|
|
@ -480,7 +480,7 @@ to a cloze type first, via Edit>Change Note Type."""))
|
||||||
# find the highest existing cloze
|
# find the highest existing cloze
|
||||||
highest = 0
|
highest = 0
|
||||||
for name, val in list(self.note.items()):
|
for name, val in list(self.note.items()):
|
||||||
m = re.findall("\{\{c(\d+)::", val)
|
m = re.findall(r"\{\{c(\d+)::", val)
|
||||||
if m:
|
if m:
|
||||||
highest = max(highest, sorted([int(x) for x in m])[-1])
|
highest = max(highest, sorted([int(x) for x in m])[-1])
|
||||||
# reuse last?
|
# reuse last?
|
||||||
|
@ -633,7 +633,7 @@ to a cloze type first, via Edit>Change Note Type."""))
|
||||||
finally:
|
finally:
|
||||||
self.mw.progress.finish()
|
self.mw.progress.finish()
|
||||||
# strip off any query string
|
# strip off any query string
|
||||||
url = re.sub("\?.*?$", "", url)
|
url = re.sub(r"\?.*?$", "", url)
|
||||||
path = urllib.parse.unquote(url)
|
path = urllib.parse.unquote(url)
|
||||||
return self.mw.col.media.writeData(path, filecontents, typeHint=ct)
|
return self.mw.col.media.writeData(path, filecontents, typeHint=ct)
|
||||||
|
|
||||||
|
@ -666,7 +666,7 @@ to a cloze type first, via Edit>Change Note Type."""))
|
||||||
|
|
||||||
# in internal pastes, rewrite mediasrv references to relative
|
# in internal pastes, rewrite mediasrv references to relative
|
||||||
if internal:
|
if internal:
|
||||||
m = re.match("http://127.0.0.1:\d+/(.*)$", src)
|
m = re.match(r"http://127.0.0.1:\d+/(.*)$", src)
|
||||||
if m:
|
if m:
|
||||||
tag['src'] = m.group(1)
|
tag['src'] = m.group(1)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue