#NEWLINE# def create_target_list_menu( self , menu , name , func , include_animated = False ) : #NEWLINE# #INDENT# targets = glob . glob ( 'targets/*.target' ) #NEWLINE# if include_animated : #NEWLINE# #INDENT# targets . extend ( glob . glob ( 'animated_targets/*.target' ) ) #NEWLINE# #UNINDENT# target_list_menu = Tkinter . Menu ( menu , tearoff = False ) #NEWLINE# for target in targets : #NEWLINE# #INDENT# ( root , ext ) = os . path . splitext ( os . path . basename ( target ) ) #NEWLINE# target_list_menu . add_command ( label = root , command = self . callback_factory ( func , target ) ) #NEWLINE# #UNINDENT# menu . add_cascade ( label = name , menu = target_list_menu ) #NEWLINE# return target_list_menu