def on_message(self, message): console.log('RECV: '.format(message.data)) msg = UI.Card(title='RECV', body=message.data) msg.show()
def send(self, message): console.log('SEND: '.format(message)) self.socket.send(message)
def on_close(self, event): self.connected = False console.log('Disconnected')
def on_open(self, event): self.connected = True console.log('Connected') self.send('Hello Websockets!')
def on_error(self, error): self.connected = False console.log('Failed to connect.') console.log('Error: \n{}'.format(error))
def test_console(): console.log('Hello from Console Test, let us begin.')