X-Git-Url: https://projects.mako.cc/source/yourule/blobdiff_plain/1711747333c7666b644f6124de39c49cd0b26526..2b6309dc7c65b8849fcd9aa7aae834b014ab5a10:/yourule.py diff --git a/yourule.py b/yourule.py index 9010217..c5ffdb7 100755 --- a/yourule.py +++ b/yourule.py @@ -7,14 +7,16 @@ from storm.locals import * from svgruler import SVGRuler # the url map for the application -urls = ( '/', 'index', +urls = ( '/?', 'index', '/ruler_([0-9\.]+)px_([0-9\.]+)([A-Za-z]+).(svg|png|jpg)', 'ruler_img', '/show/(.*(svg|png|jpg))', 'show_ruler', '/gallery(.*)', 'gallery', '/delete/(\d+)', 'delete', '/undelete/(\d+)', 'undelete') -database = create_database("sqlite:yourule.db") +database = create_database("sqlite:%s/db/yourule.db" % + os.path.dirname(__file__)) + store = Store(database) class Ruler(object): @@ -132,7 +134,7 @@ class gallery: def POST(self, ruler_url): input = web.input() - errormsg = valid_input(input) + errormsg = validate_input(input) if not input.model: errormsg = 'Please fill out all fields.' @@ -216,5 +218,5 @@ web.webapi.internalerror = web.debugerror if __name__ == "__main__": web.run(urls, globals(), web.reloader) -application = web.wsgifunc(web.webpyfunc(urls, globals())) +#application = web.wsgifunc(web.webpyfunc(urls, globals()))