def handle_setName(self, name): self.log.debug('Setting name to {name}', name=name) try: yield self._talker.setName(name) except ValueError: response = {'action': 'setNameFailed'} else: response = {'action': 'setNameSuccess'} self.sendMessage(dumps(response))
def handle_setName(self, name): self.log.debug("Setting name to {name}", name=name) try: yield self._talker.setName(name) except ValueError: response = {"action": "setNameFailed"} else: response = {"action": "setNameSuccess"} self.sendMessage(dumps(response))
def sendAction(self, payload=None, action=None): self.sendMessage(dumps({ 'action': action, 'payload': payload }))
def sendAction(self, payload=None, action=None): self.sendMessage(dumps({'action': action, 'payload': payload}))
def sendAction(self, payload=None, action=None): self.sendMessage(dumps({"action": action, "payload": payload}))