ocl: add try-catch for OpenCL device getter
[profile/ivi/opencv.git] / doc / patch_refman_latex.py
1 #!/usr/bin/env python
2
3 import sys
4
5 f=open(sys.argv[1], "rt")
6 ll = list(f.readlines())
7 f.close()
8 f=open(sys.argv[1], "wt")
9 singleparam = False
10
11 for l in ll:
12     l = l.replace("\\code{~const}}{}", "}{\\code{~const}}")
13     if l.startswith("\\item[{Parameters}] \\leavevmode"):
14         if not l.startswith("\\item[{Parameters}] \\leavevmode\\begin{itemize}"):
15             singleparam = True
16         l = "\\item[{Parameters}] \\leavevmode\\begin{itemize}[label=]\n"
17         if singleparam:
18             l += "\\item {}\n"
19     elif singleparam and l.startswith("\\end{description}\\end{quote}"):
20         l = "\\end{itemize}\n" + l
21         singleparam = False
22     f.write(l)
23
24 f.close()