Skip to content

Commit

Permalink
adding test bed for statistic #610
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Letter committed Mar 25, 2016
1 parent 0642e31 commit 56e3cd4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 3 additions & 1 deletion packages/slycat/web/server/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ def abspath(path):
dispatcher.connect("get-remote-video", "/remotes/:sid/videos/:vsid", slycat.web.server.handlers.get_remote_video, conditions={"method" : ["GET"]})
dispatcher.connect("get-remote-video-status", "/remotes/:sid/videos/:vsid/status", slycat.web.server.handlers.get_remote_video_status, conditions={"method" : ["GET"]})
dispatcher.connect("get-user", "/users/:uid", slycat.web.server.handlers.get_user, conditions={"method" : ["GET"]})
#dispatcher.connect("get-model-statistics", "/users/:mid", slycat.web.server.handlers.get_model_statistics, conditions={"method" : ["GET"]})

dispatcher.connect("get-model-statistics", "/get-model-statistics/:mid", slycat.web.server.handlers.get_model_statistics, conditions={"method" : ["GET"]})

dispatcher.connect("model-command", "/models/:mid/commands/:type/:command", slycat.web.server.handlers.model_command, conditions={"method" : ["GET", "POST", "PUT"]})
dispatcher.connect("model-sensitive-command", "/models/:mid/sensitive/:type/:command", slycat.web.server.handlers.model_sensitive_command, conditions={"method" : ["POST"]})
dispatcher.connect("post-events", "/events/{event:.*}", slycat.web.server.handlers.post_events, conditions={"method" : ["POST"]})
Expand Down
6 changes: 2 additions & 4 deletions packages/slycat/web/server/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1613,12 +1613,10 @@ def get_model_statistics(mid):
model = database.get("model", mid)
project = database.get("project", model["project"])
except:
raise cherrypy.HTTPError(404)
raise cherrypy.HTTPError("404 error: %s" % mid)
slycat.web.server.authentication.require_project_reader(project)


#TODO logic
# return json
return {"mystats":"hello world of stats", "mid":mid, "model":model}

@cherrypy.tools.json_in(on = True)
@cherrypy.tools.json_out(on = True)
Expand Down

0 comments on commit 56e3cd4

Please sign in to comment.