1 from plasTeX import Base
2 from plasTeX.Base.LaTeX.Verbatim import verbatim
3 from plasTeX.Base.LaTeX import Sectioning
6 class includegraphics(Base.Command):
9 Base.Command.invoke(self, tex)
11 class cvfunc(Sectioning.subsection):
12 def invoke(self, tex):
13 Sectioning.subsection.invoke(self, tex)
15 class cvstruct(Sectioning.subsection):
16 def invoke(self, tex):
17 Sectioning.subsection.invoke(self, tex)
19 class cvmacro(Sectioning.subsection):
20 def invoke(self, tex):
21 Sectioning.subsection.invoke(self, tex)
23 class cross(Base.Command):
25 def invoke(self, tex):
26 Base.Command.invoke(self, tex)
28 class label(Base.Command):
30 def invoke(self, tex):
31 Base.Command.invoke(self, tex)
33 class url(Base.Command):
35 def invoke(self, tex):
36 Base.Command.invoke(self, tex)
38 class cvarg(Base.Command):
40 def invoke(self, tex):
41 Base.Command.invoke(self, tex)
43 class cvexp(Base.Command):
45 def invoke(self, tex):
46 Base.Command.invoke(self, tex)
48 class cvC(Base.Command):
50 def invoke(self, tex):
51 Base.Command.invoke(self, tex)
53 class cvPy(Base.Command):
55 def invoke(self, tex):
56 Base.Command.invoke(self, tex)
58 class xxindex(Base.Command):
60 def invoke(self, tex):
61 Base.Command.invoke(self, tex)
63 class lstlisting(verbatim):
65 verbatim.parse(self, tex)
66 return self.attributes
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"
73 class chapter(Sectioning.chapter):
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']
80 raise AttributeError, 'This chapter does not generate a new file'
83 class section(Sectioning.section):
85 def filenameoverride(self):
86 if self.attributes['title'] is not None:
87 filename = section_filename(str(self.attributes['title']))
88 print 'section:', filename
90 raise AttributeError, 'This section does not generate a new file'
92 class xifthenelse(Base.Command):
93 args = 'test then else'
95 class _not(Base.Command):
98 class _and(Base.Command):
101 class _or(Base.Command):
104 class NOT(Base.Command):
107 class AND(Base.Command):
110 class OR(Base.Command):
113 class openParen(Base.Command):
116 class closeParen(Base.Command):
119 class isodd(Base.Command):
122 class isundefined(Base.Command):
125 class equal(Base.Command):
126 args = 'first second'
128 class lengthtest(Base.Command):
131 class boolean(Base.Command):