Exemplo n.º 1
0
 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})
Exemplo n.º 2
0
 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})
Exemplo n.º 3
0
 def get_engine_id(self, nbid):
     user =  json.loads(self.get_current_user())['user']
     return nbid + '/' + user
Exemplo n.º 4
0
 def get_engine_id(self, nbid):
     user = json.loads(self.get_current_user())['user']
     return nbid + '/' + user