Belle II Software development
Listing Class Reference
Inheritance diagram for Listing:
LatexObject

Public Member Functions

def __init__ (self, language='XML')
 
def add (self, text='')
 
def finish (self, **kwargs)
 

Detailed Description

Used for wrapping code in a listing environment

Definition at line 196 of file b2latex.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  language = 'XML' 
)
Calls super-class initialize and adds initial text to output
    @param text intial text, usually you want to give a raw string r"some text"

Reimplemented from LatexObject.

Definition at line 201 of file b2latex.py.

201 def __init__(self, language='XML'):
202 """
203 Calls super-class initialize and adds initial text to output
204 @param text intial text, usually you want to give a raw string r"some text"
205 """
206 super().__init__()
207
208 self.output += r'\lstset{language=' + language + '}\n'
209 self.output += r'\begin{lstlisting}[breaklines=true]' + '\n'
210

Member Function Documentation

◆ add()

def add (   self,
  text = '' 
)
Adds code to the output
    @param code which is wrapped in the listing environment

Reimplemented from LatexObject.

Definition at line 211 of file b2latex.py.

211 def add(self, text=''):
212 """
213 Adds code to the output
214 @param code which is wrapped in the listing environment
215 """
216 self.output += str(text)
217 return self
218

◆ finish()

def finish (   self,
**  kwargs 
)
Finish the generation of the lsiting environment

Reimplemented from LatexObject.

Definition at line 219 of file b2latex.py.

219 def finish(self, **kwargs):
220 """
221 Finish the generation of the lsiting environment
222 """
223
224 self.output += r'\end{lstlisting}'
225 return self
226
227

The documentation for this class was generated from the following file: