##// END OF EJS Templates
i18n: ignore doctest part to avoid warning at "make update-pot"...
FUJIWARA Katsunori -
r33816:726dd73d default
parent child Browse files
Show More
@@ -24,6 +24,7 b' from __future__ import absolute_import, '
24
24
25 import inspect
25 import inspect
26 import os
26 import os
27 import re
27 import sys
28 import sys
28
29
29
30
@@ -60,9 +61,15 b' def poentry(path, lineno, s):'
60 'msgid %s\n' % normalize(s) +
61 'msgid %s\n' % normalize(s) +
61 'msgstr ""\n')
62 'msgstr ""\n')
62
63
64 doctestre = re.compile(r'^ +>>> ', re.MULTILINE)
63
65
64 def offset(src, doc, name, default):
66 def offset(src, doc, name, default):
65 """Compute offset or issue a warning on stdout."""
67 """Compute offset or issue a warning on stdout."""
68 # remove doctest part, in order to avoid backslash mismatching
69 m = doctestre.search(doc)
70 if m:
71 doc = doc[:m.start()]
72
66 # Backslashes in doc appear doubled in src.
73 # Backslashes in doc appear doubled in src.
67 end = src.find(doc.replace('\\', '\\\\'))
74 end = src.find(doc.replace('\\', '\\\\'))
68 if end == -1:
75 if end == -1:
General Comments 0
You need to be logged in to leave comments. Login now