#NEWLINE# def onMessage( self , payload , isBinary ) : #NEWLINE# #INDENT# if isBinary : #NEWLINE# #INDENT# print ( 'Binary message received: {0} bytes' . format ( len ( payload ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# print ( 'Text message received: {0}' . format ( payload . decode ( 'utf8' ) ) ) #NEWLINE# #UNINDENT# self . _received += 1 #NEWLINE# frame = payload . factory . _app . _frame #NEWLINE# frame . sizeCtrl . SetValue ( '{}' . format ( self . _received ) )