import json import cherrypy from lib import uuid class Dispatcher(object): def validate_uuid(self, uuid4): if not uuid.validate(uuid4): self.error(1, 'Invalid UUID in request') def error(self, code, message='An application error occurred'): raise cherrypy.HTTPError(400, self.response({'error': {'code': int(code), 'message': str(message)}}) ) def GET(self, id=None): raise cherrypy.HTTPError(405) def POST(self, id, status): raise cherrypy.HTTPError(405) def PUT(self): raise cherrypy.HTTPError(405) def DELETE(self): raise cherrypy.HTTPError(405)