#NEWLINE# def onMessage( self , msg ) : #NEWLINE# #INDENT# eventType = msg . get ( 'event' ) #NEWLINE# if ( eventType == 'pusher:error' ) : #NEWLINE# #INDENT# self . onError ( Event ( msg , False ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( eventType == 'pusher:ping' ) : #NEWLINE# #INDENT# self . sendPong ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( eventType == 'pusher:connection_established' ) : #NEWLINE# #INDENT# self . onConnectionEstablished ( Event ( msg , True ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( eventType == 'pusher_internal:subscription_succeeded' ) : #NEWLINE# #INDENT# self . onSubscriptionSucceeded ( Event ( self , True ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . onUnknownEvent ( Event ( msg , False ) )