def callback(): app = request.args[0] command = request.vars.statement session['debug_commands:' + app].append(command) output = communicate(command) k = len(session['debug_commands:' + app]) - 1 return '[%i] %s%s\n' % (k + 1, command, output)
def index(): app = request.args(0) or 'admin' reset() # read buffer data = communicate() return dict(app=app, data=data)