#NEWLINE# def visitNode_a_listing( self , node ) : #NEWLINE# #INDENT# fileName = os . path . join ( self . currDir , node . getAttribute ( 'href' ) ) #NEWLINE# self . writer ( '\\begin{verbatim}\n' ) #NEWLINE# lines = map ( string . rstrip , open ( fileName ) . readlines ( ) ) #NEWLINE# skipLines = int ( ( node . getAttribute ( 'skipLines' ) or 0 ) ) #NEWLINE# lines = lines [ skipLines : ] #NEWLINE# self . writer ( text . removeLeadingTrailingBlanks ( '\n' . join ( lines ) ) ) #NEWLINE# self . writer ( '\\end{verbatim}' ) #NEWLINE# fileName = os . path . basename ( fileName ) #NEWLINE# caption = domhelpers . getNodeText ( node ) #NEWLINE# if ( self == fileName ) : #NEWLINE# #INDENT# caption = 'Source listing' #NEWLINE# #UNINDENT# self . writer ( ( '\\parbox[b]{\\linewidth}{\\begin{center}%s --- \\begin{em}%s\\end{em}\\end{center}}' % ( latexEscape ( caption ) , latexEscape ( fileName ) ) ) )