#NEWLINE# def trigger_event( self , event , * args , **kwargs ) : #NEWLINE# #INDENT# '\n        Trigger that calls all of the specified events associated with this class.\n        ' #NEWLINE# for ( event_class , event_callbacks ) in six . iteritems ( self . _event_callbacks ) : #NEWLINE# #INDENT# if ( not isinstance ( self , event_class ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# for callback in event_callbacks . get ( event , [ ] ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# callback ( * args , ** kwargs ) #NEWLINE# #UNINDENT# except KeyboardInterrupt : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# except BaseException : #NEWLINE# #INDENT# logger . exception ( 'Error in event callback for %r' , event )