#NEWLINE# def on_message( self , raw_message ) : #NEWLINE# #INDENT# message = json . loads ( raw_message ) #NEWLINE# event_type = message . get ( 'type' ) #NEWLINE# try : #NEWLINE# #INDENT# event_class = self . event_callbacks [ event_type ] #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# print ( ( "I don't know how to process '%s' events!" % event ) ) #NEWLINE# return #NEWLINE# #UNINDENT# event = event_class ( ** message ) #NEWLINE# self . app . widget_event ( event )