From 1f4160511f4853de614355f45b94152fbd19e29e Mon Sep 17 00:00:00 2001 From: ngharo Date: Wed, 3 Jan 2018 19:47:41 -0600 Subject: -~-~ Under Construction ~-~-~~~~~ --- server/buttonDispatcher.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'server/buttonDispatcher.py') diff --git a/server/buttonDispatcher.py b/server/buttonDispatcher.py index 8938288..d3331bd 100644 --- a/server/buttonDispatcher.py +++ b/server/buttonDispatcher.py @@ -1,12 +1,12 @@ import json -import cherrypy +from bottle import Bottle, route from button import loadAll, Button from dispatcher import Dispatcher from lib import uuid # Tweak: consider using serpy for serializing objects for JSON. -@cherrypy.expose +@app.route('/') class ButtonDispatcher(Dispatcher): @cherrypy.tools.json_out() def GET(self, id=None): @@ -39,7 +39,7 @@ class ButtonDispatcher(Dispatcher): return button.toDict() @cherrypy.tools.json_out() - def PUT(self, id, status): + def PUT(self, id): # POST /button/{id}?status={} - updates button status self.validate_uuid(id) @@ -54,8 +54,10 @@ class ButtonDispatcher(Dispatcher): return button.toDict() @cherrypy.tools.json_out() - def DELETE(self, id): + def DELETE(self, id, status, *path, **args): # DELETE /button/{id} - deletes button + self.validate_uuid(id) + button = Button() button.loadById(id) button.delete() -- cgit v1.2.3