#NEWLINE# def add_selected_to_database( self , * l ) : #NEWLINE# #INDENT# if ( self . selected is None ) : #NEWLINE# #INDENT# raise Exception ( 'add_gesture_to_database before load_visualizer?' ) #NEWLINE# #UNINDENT# if ( self . gesturesettingsform . addsettings is None ) : #NEWLINE# #INDENT# raise Exception ( 'add_gesture_to_database missing addsetings?' ) #NEWLINE# #UNINDENT# ids = self . gesturesettingsform . addsettings . ids #NEWLINE# name = ids . name . value . strip ( ) #NEWLINE# if ( name == '' ) : #NEWLINE# #INDENT# self . infopopup . auto_dismiss = True #NEWLINE# self . infopopup . text = 'You must specify a name for the gesture' #NEWLINE# self . infopopup . open ( ) #NEWLINE# return #NEWLINE# #UNINDENT# permute = ids . permute . value #NEWLINE# sensitive = ids . orientation_sens . value #NEWLINE# strokelen = sensitive . stroke_sens . value #NEWLINE# angle_sim = ids . angle_sim . value #NEWLINE# cand = self . selected . _result_obj . _gesture_obj . get_vectors ( ) #NEWLINE# if ( permute and ( len ( cand ) > MAX_PERMUTE_STROKES ) ) : #NEWLINE# #INDENT# t = ( "Can't heap permute %d-stroke gesture " % len ( cand ) ) #NEWLINE# self . infopopup . text = t #NEWLINE# self . infopopup . auto_dismiss = True #NEWLINE# self . infopopup . open ( ) #NEWLINE# return #NEWLINE# #UNINDENT# self . recognizer . add_gesture ( name , cand , use_strokelen = strokelen , orientation_sensitive = sensitive , angle_similarity = angle_sim , permute = permute ) #NEWLINE# self . infopopup . text = 'Gesture added to database' #NEWLINE# self . infopopup . auto_dismiss = True #NEWLINE# self . infopopup . open ( )