#NEWLINE# def sendEvent( self , eventType , eventData ) : #NEWLINE# #INDENT# msgDict = { #NEWLINE# #INDENT# 'event' : eventType , #NEWLINE# #UNINDENT# } #NEWLINE# if eventData : #NEWLINE# #INDENT# msgDict [ 'data' ] = eventData #NEWLINE# #UNINDENT# msg = json . dumps ( msgDict ) #NEWLINE# self . send ( msg , False )