def _readOut(self, data): try: self.readSExpr(sexpr.str2sexpr(data)) except ValueError: self.writeSExpr(['malformed-message', data])
def stringReceived(self, string): expr = str2sexpr(string) for command in expr: result = self.app.run(command) if result: self.sendString(sexpr2str(result))