Exemplo n.º 1
0
 def post(self, proj_name, stats_name):
     try:
         data = json.loads(self.request.body)
         st = Projects().get(proj_name).get_stats(stats_name)
         if st is not None:
             st.set(data, proj_name)
         else:
             logger.error("The project %s doesn't contain the %s stats!"%(proj_name,stats_name))
             raise HTTPError(400)
     except Exception, e:
         logger.error(e)
         raise HTTPError(400)
Exemplo n.º 2
0
 def get(self, proj_name, stats_name):
     try:
         st = Projects().get(proj_name).get_stats(stats_name)
         if st is not None:
             features = st.features()
             if features is not None:
                 self.write({'output': {'features': features}})
             else:
                 raise HTTPError(404)
         else:
             logger.error("The project %s doesn't contain the %s stats!"%(proj_name,stats_name))
             raise HTTPError(400)
     except Exception, e:
         logger.error(e)
         raise HTTPError(400)