#NEWLINE# def _active_change( self , mode , active ) : #NEWLINE# #INDENT# if active : #NEWLINE# #INDENT# self . active_modes . append ( mode ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . active_modes . remove ( self ) #NEWLINE# #UNINDENT# self . active_modes . sort ( key = ( lambda x : x . priority ) , reverse = True ) #NEWLINE# self . dump ( )