mirror of
https://github.com/zebrajr/opencv.git
synced 2025-12-06 12:19:50 +01:00
Merge pull request #26579 from FantasqueX:fix-re-warning-1
Fix python re warning
This commit is contained in:
commit
7fbf3c1fec
|
|
@ -1120,7 +1120,7 @@ class ObjectiveCWrapperGenerator(object):
|
||||||
name = line[p0:p1]
|
name = line[p0:p1]
|
||||||
for arg in args:
|
for arg in args:
|
||||||
if arg.name == name:
|
if arg.name == name:
|
||||||
toWrite.append(re.sub('\*\s*@param ', '* @param ', line))
|
toWrite.append(re.sub(r'\*\s*@param ', '* @param ', line))
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
s0 = line.find("@see")
|
s0 = line.find("@see")
|
||||||
|
|
@ -1512,13 +1512,13 @@ def escape_underscore(str):
|
||||||
return str.replace('_', '\\_')
|
return str.replace('_', '\\_')
|
||||||
|
|
||||||
def escape_texttt(str):
|
def escape_texttt(str):
|
||||||
return re.sub(re.compile('texttt{(.*?)\}', re.DOTALL), lambda x: 'texttt{' + escape_underscore(x.group(1)) + '}', str)
|
return re.sub(re.compile('texttt{(.*?)}', re.DOTALL), lambda x: 'texttt{' + escape_underscore(x.group(1)) + '}', str)
|
||||||
|
|
||||||
def get_macros(tex):
|
def get_macros(tex):
|
||||||
out = ""
|
out = ""
|
||||||
if re.search("\\\\fork\s*{", tex):
|
if re.search(r"\\fork\s*{", tex):
|
||||||
out += "\\newcommand{\\fork}[4]{ \\left\\{ \\begin{array}{l l} #1 & \\text{#2}\\\\\\\\ #3 & \\text{#4}\\\\\\\\ \\end{array} \\right.} "
|
out += "\\newcommand{\\fork}[4]{ \\left\\{ \\begin{array}{l l} #1 & \\text{#2}\\\\\\\\ #3 & \\text{#4}\\\\\\\\ \\end{array} \\right.} "
|
||||||
if re.search("\\\\vecthreethree\s*{", tex):
|
if re.search(r"\\vecthreethree\s*{", tex):
|
||||||
out += "\\newcommand{\\vecthreethree}[9]{ \\begin{bmatrix} #1 & #2 & #3\\\\\\\\ #4 & #5 & #6\\\\\\\\ #7 & #8 & #9 \\end{bmatrix} } "
|
out += "\\newcommand{\\vecthreethree}[9]{ \\begin{bmatrix} #1 & #2 & #3\\\\\\\\ #4 & #5 & #6\\\\\\\\ #7 & #8 & #9 \\end{bmatrix} } "
|
||||||
return out
|
return out
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user