#NEWLINE# def parse_col( self , col_chars ) : #NEWLINE# #INDENT# c = col_chars . copy ( ) #NEWLINE# c [ 'x0rel' ] = ( c [ 'x0' ] - c [ 'x0' ] . min ( ) ) #NEWLINE# results_lines = c . groupby ( 'top' ) . apply ( parse_results_line ) #NEWLINE# items = [ ] #NEWLINE# item = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# vote_seen = False #NEWLINE# for ( i , r ) in results_lines . iteritems ( ) : #NEWLINE# #INDENT# if ( r [ 'votes' ] == None ) : #NEWLINE# #INDENT# if ( c == True ) : #NEWLINE# #INDENT# items . append ( item ) #NEWLINE# item = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# vote_seen = False #NEWLINE# #UNINDENT# item [ 'desc' ] = ( ( ( item [ 'desc' ] + '|' ) + r [ 'text' ] ) if item . get ( 'desc' , False ) else r [ 'text' ] ) #NEWLINE# #UNINDENT# if ( type ( r [ 'votes' ] ) == int ) : #NEWLINE# #INDENT# vote_seen = True #NEWLINE# item [ 'options' ] = item . get ( 'options' , [ ] ) #NEWLINE# item [ 'options' ] . append ( r ) #NEWLINE# #UNINDENT# #UNINDENT# items . append ( item ) #NEWLINE# return items