#NEWLINE# def trim_right_of_sel( self , * args ) : #NEWLINE# #INDENT# 'Cut list items with indices in sorted_keys that are greater than\n        the index of the last selected item, if there is a selection.\n\n        sorted_keys will be updated by update_for_new_data().\n        ' #NEWLINE# if ( len ( self . selection ) > 0 ) : #NEWLINE# #INDENT# selected_keys = [ sel . text for sel in self . selection ] #NEWLINE# last_sel_index = self . sorted_keys . index ( selected_keys [ ( - 1 ) ] ) #NEWLINE# desired_keys = self . sorted_keys [ : ( last_sel_index + 1 ) ] #NEWLINE# self . data = dict ( [ ( key , self . data [ key ] ) for key in desired_keys ] )