#NEWLINE# def to_text( self ) : #NEWLINE# #INDENT# labels = [ ] #NEWLINE# visible_cols = list ( filter ( ( lambda col : col . visible ) , self . columns ) ) #NEWLINE# for col in visible_cols : #NEWLINE# #INDENT# labels . append ( col . label ) #NEWLINE# #UNINDENT# table = prettytable . PrettyTable ( labels ) #NEWLINE# for col in visible_cols : #NEWLINE# #INDENT# table . align [ col . label ] = col . align #NEWLINE# #UNINDENT# table . padding_width = 1 #NEWLINE# indent = 2 #NEWLINE# def output_text( row_data , depth ) : #NEWLINE# #INDENT# fields = list ( map ( ( lambda col : col . get_value ( self , row_data ) ) , visible_cols ) ) #NEWLINE# fields [ 0 ] = ( ( ( ' ' * indent ) * depth ) + fields [ 0 ] ) #NEWLINE# table . add_row ( fields ) #NEWLINE# return depth #NEWLINE# #UNINDENT# def inc_depth( depth ) : #NEWLINE# #INDENT# return ( depth + 1 ) #NEWLINE# #UNINDENT# self . iter_rowlist ( self . rows , output_text , 0 , inc_depth ) #NEWLINE# prolog = '' #NEWLINE# if ( self . title is not None ) : #NEWLINE# #INDENT# prolog = ( format_title ( self . title ) + '\n' ) #NEWLINE# #UNINDENT# return ( ( prolog + str ( table ) ) + '\n' )