#NEWLINE# def load_visualizer( self , visualizer ) : #NEWLINE# #INDENT# if ( self . addsettings is None ) : #NEWLINE# #INDENT# self . addsettings = AddGestureSettings ( ) #NEWLINE# self . ids . settings . add_widget ( self . addsettings ) #NEWLINE# #UNINDENT# self . visualizer = visualizer #NEWLINE# analysis = self . ids . analysis #NEWLINE# analysis . clear_widgets ( ) #NEWLINE# analysis . add_widget ( self . rrdetails ) #NEWLINE# scrollv = self . rrdetails . ids . result_scrollview #NEWLINE# resultlist = self . rrdetails . ids . result_list #NEWLINE# resultlist . clear_widgets ( ) #NEWLINE# r = visualizer . _result_obj . results #NEWLINE# if ( not len ( r ) ) : #NEWLINE# #INDENT# lbl = RecognizerResultLabel ( text = '[b]No match[/b]' ) #NEWLINE# resultlist . add_widget ( lbl ) #NEWLINE# scrollv . scroll_y = 1 #NEWLINE# return #NEWLINE# #UNINDENT# if PY2 : #NEWLINE# #INDENT# d = r . iteritems #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# d = r . items #NEWLINE# #UNINDENT# for one in sorted ( d ( ) , key = ( lambda x : x [ 1 ] [ 'score' ] ) , reverse = True ) : #NEWLINE# #INDENT# data = one [ 1 ] #NEWLINE# lbl = RecognizerResultLabel ( text = ( ( ( ( ( ( 'Name: [b]' + data [ 'name' ] ) + '[/b]' ) + '\n      Score: ' ) + str ( data [ 'score' ] ) ) + '\n      Distance: ' ) + str ( visualizer [ 'dist' ] ) ) ) #NEWLINE# resultlist . add_widget ( lbl ) #NEWLINE# #UNINDENT# scrollv . scroll_y = 1