def post(self, nbid): eid = self.get_engine_id(nbid) data = json.loads(self.request.body) print eid, data if data['method'] == 'start': result = yield manager.start(eid) elif data['method'] == 'evaluate': result = yield manager.evaluate(eid, data['input']) elif data['method'] == 'interrupt': result = yield manager.interrupt(eid) elif data['method'] == 'stop': result = yield manager.stop(eid) self.write({'result': result})
def get_engine_id(self, nbid): user = json.loads(self.get_current_user())['user'] return nbid + '/' + user