def post(self): try: events = recordexec.recordexec(self.request.get("source")) result = {"type": "success", "events": events} except recordexec.CompilationError, e: # http://docs.python.org/library/exceptions.html#exceptions.SyntaxError result = {"type": "error", "msg": e.err.msg, "lineno": e.err.lineno}
def render_POST(self, request): try: events = recordexec.recordexec(request.args["source"][0]) result = { 'type': 'success', 'events': events } except recordexec.CompilationError, e: result = { 'type': 'error', 'msg': e.err.msg, 'lineno': e.err.lineno }