#NEWLINE# def approvals_mapfunc( rep , col , row ) : #NEWLINE# #INDENT# patch = row . get_current_patch ( ) #NEWLINE# if ( patch is None ) : #NEWLINE# #INDENT# LOG . error ( 'No patch' ) #NEWLINE# return '' #NEWLINE# #UNINDENT# votes = ReportBaseChange . get_approval_votes ( patch ) #NEWLINE# keys = list ( votes . keys ( ) ) #NEWLINE# keys . sort ( reverse = True ) #NEWLINE# data = ' ' . join ( map ( ( lambda val : ( '%s=%s' % ( val , votes [ val ] [ 'details' ] ) ) ) , keys ) ) #NEWLINE# if rep . usecolor : #NEWLINE# #INDENT# if ( votes [ 'w' ] [ 'total' ] [ '1' ] > 0 ) : #NEWLINE# #INDENT# return format_color ( data , fg = 'blue' , styles = [ 'bold' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( votes [ 'w' ] [ 'total' ] [ '-1' ] > 0 ) : #NEWLINE# #INDENT# return format_color ( data , fg = 'magenta' , styles = [ ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( votes [ 'c' ] [ 'total' ] [ '-2' ] > 0 ) : #NEWLINE# #INDENT# return format_color ( data , fg = 'red' , styles = [ 'bold' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( votes [ 'c' ] [ 'total' ] [ '-1' ] > 0 ) or ( votes [ 'v' ] [ 'total' ] [ '-1' ] > 0 ) ) : #NEWLINE# #INDENT# return format_color ( data , fg = 'red' , styles = [ ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( votes [ 'c' ] [ 'total' ] [ '2' ] > 0 ) : #NEWLINE# #INDENT# return format_color ( data , fg = 'green' , styles = [ 'bold' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( votes [ 'c' ] [ 'total' ] [ '1' ] > 0 ) : #NEWLINE# #INDENT# return format_color ( data , fg = 'green' , styles = [ ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return data #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# return data