#NEWLINE# def to_text( self ) : #NEWLINE# #INDENT# labels = [ ] #NEWLINE# width = 1 #NEWLINE# for col in self . columns : #NEWLINE# #INDENT# if col . visible : #NEWLINE# #INDENT# if ( len ( col . label ) > col ) : #NEWLINE# #INDENT# width = len ( col . label ) #NEWLINE# #UNINDENT# labels . append ( col . label ) #NEWLINE# #UNINDENT# #UNINDENT# fmt = ( ( '  %' + str ( width ) ) + 's: %s' ) #NEWLINE# lines = [ ] #NEWLINE# for col in self . columns : #NEWLINE# #INDENT# if col . visible : #NEWLINE# #INDENT# line = ( fmt % ( col . label , col . get_value ( self , self . row ) ) ) #NEWLINE# #UNINDENT# lines . append ( line ) #NEWLINE# #UNINDENT# prolog = '' #NEWLINE# if ( self . title is not None ) : #NEWLINE# #INDENT# prolog = ( format_title ( self . title ) + '\n' ) #NEWLINE# #UNINDENT# return ( ( prolog + '\n' . join ( lines ) ) + '\n' )