#NEWLINE# def _add_ids_to_menu_options( self , menu_options ) : #NEWLINE# #INDENT# result = [ ] #NEWLINE# for menu_option in menu_options : #NEWLINE# #INDENT# ( option_text , option_icon , option_action ) = menu_option #NEWLINE# if ( isinstance ( result , collections . Callable ) or ( option_action in self . SPECIAL_ACTIONS ) ) : #NEWLINE# #INDENT# self . menu_actions_by_id . add ( ( self . _next_action_id , option_action ) ) #NEWLINE# result . append ( ( menu_option + ( self . _next_action_id , ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if non_string_iterable ( option_action ) : #NEWLINE# #INDENT# result . append ( ( option_text , option_icon , self . _add_ids_to_menu_options ( option_action ) , self . _next_action_id ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# print ( 'Unknown item' , option_text , option_icon , option_action ) #NEWLINE# #UNINDENT# #UNINDENT# self . _next_action_id += 1 #NEWLINE# #UNINDENT# return result