Update to 2.0.0 tree from current Fremantle build
[opencv] / doc / plastex / myopencv.py
1 from plasTeX import Base
2 from plasTeX.Base.LaTeX.Verbatim import verbatim
3 from plasTeX.Base.LaTeX import Sectioning
4 import sys
5
6 class includegraphics(Base.Command):
7   args = '[size] file'
8   def invoke(self, tex):
9     Base.Command.invoke(self, tex)
10
11 class cvfunc(Sectioning.subsection):
12   def invoke(self, tex):
13     Sectioning.subsection.invoke(self, tex)
14
15 class cvstruct(Sectioning.subsection):
16   def invoke(self, tex):
17     Sectioning.subsection.invoke(self, tex)
18
19 class cvmacro(Sectioning.subsection):
20   def invoke(self, tex):
21     Sectioning.subsection.invoke(self, tex)
22
23 class cross(Base.Command):
24   args = 'name'
25   def invoke(self, tex):
26     Base.Command.invoke(self, tex)
27
28 class label(Base.Command):
29   args = 'name'
30   def invoke(self, tex):
31     Base.Command.invoke(self, tex)
32
33 class url(Base.Command):
34   args = 'loc'
35   def invoke(self, tex):
36     Base.Command.invoke(self, tex)
37
38 class cvarg(Base.Command):
39   args = 'item def'
40   def invoke(self, tex):
41     Base.Command.invoke(self, tex)
42
43 class cvexp(Base.Command):
44   args = 'c cpp py'
45   def invoke(self, tex):
46     Base.Command.invoke(self, tex)
47
48 class cvC(Base.Command):
49   args = 'a'
50   def invoke(self, tex):
51     Base.Command.invoke(self, tex)
52
53 class cvPy(Base.Command):
54   args = 'a'
55   def invoke(self, tex):
56     Base.Command.invoke(self, tex)
57
58 class xxindex(Base.Command):
59   args = 'entry'
60   def invoke(self, tex):
61     Base.Command.invoke(self, tex)
62
63 class lstlisting(verbatim):
64   def parse(self, tex):
65     verbatim.parse(self, tex)
66     return self.attributes
67
68 def section_filename(title):
69     """Image Processing ==> image_processing.rst"""
70     lower_list = [word.lower() for word in title.split()]
71     return "_".join(lower_list) + ".rst"
72
73 class chapter(Sectioning.chapter):
74     @property
75     def filenameoverride(self):
76         if self.attributes['title'] is not None:
77             filename = section_filename(str(self.attributes['title']))
78             #assert filename in ['cxcore.rst', 'cvreference.rst']
79             return filename
80         raise AttributeError, 'This chapter does not generate a new file'
81         
82
83 class section(Sectioning.section):
84     @property
85     def filenameoverride(self):
86         if self.attributes['title'] is not None:
87             filename = section_filename(str(self.attributes['title']))
88             print 'section:', filename
89             return filename
90         raise AttributeError, 'This section does not generate a new file'
91
92 class xifthenelse(Base.Command):
93     args = 'test then else' 
94
95     class _not(Base.Command):
96         macroName = 'not'
97
98     class _and(Base.Command):
99         macroName = 'and'
100
101     class _or(Base.Command):
102         macroName = 'or'
103
104     class NOT(Base.Command):
105         pass
106
107     class AND(Base.Command):
108         pass
109
110     class OR(Base.Command):
111         pass
112
113     class openParen(Base.Command):
114         macroName = '('
115
116     class closeParen(Base.Command):
117         macroName = ')'
118
119     class isodd(Base.Command):
120         args = 'number:int'
121
122     class isundefined(Base.Command):
123         args = 'command:str'
124
125     class equal(Base.Command):
126         args = 'first second'
127
128     class lengthtest(Base.Command):
129         args = 'test'
130
131     class boolean(Base.Command):
132         args = 'name:str'