#NEWLINE# def set_counter( self ) : #NEWLINE# #INDENT# next_value = ( self . no_of_bomb - len ( self . flagged_cells ) ) #NEWLINE# if ( ( next_value == 0 ) and self . started ) : #NEWLINE# #INDENT# self . counter . setStyleName ( 'digit counter-blue' ) #NEWLINE# self . counter . addClickListener ( RemainingMineHandler ( self ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . counter . setStyleName ( 'digit counter' ) #NEWLINE# self . counter . _clickListeners = [ ] #NEWLINE# #UNINDENT# if ( next_value < 0 ) : #NEWLINE# #INDENT# template = '-00' #NEWLINE# next_value = abs ( next_value ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# template = '000' #NEWLINE# #UNINDENT# value = str ( next_value ) #NEWLINE# value = ( template [ : ( - len ( value ) ) ] + value ) #NEWLINE# self . counter . setText ( value )