From: Date: Sun, 16 Sep 2007 21:24:49 +0000 (-0400) Subject: fixed several bugs X-Git-Url: https://projects.mako.cc/source/yourule/commitdiff_plain/c61d6a6300242da86d532d34bb0506e04c9de658?hp=ee98f53330408fd5f0c0a27720a3dc0d9edced89 fixed several bugs --- diff --git a/yourule.py b/yourule.py index 3de9e7b..d6f44bd 100755 --- a/yourule.py +++ b/yourule.py @@ -4,17 +4,20 @@ from __future__ import division import web import sys, os, re from storm.locals import * + +# recalculate the path based on the location of the file +sys.path.append(os.path.dirname(__file__)) from svgruler import SVGRuler from jinja import Environment, FileSystemLoader jinja_env = Environment('<%', '%>', '<%=', '%>', '<%#', '%>', - loader=FileSystemLoader('templates/')) + loader=FileSystemLoader(os.path.dirname(__file__) + "/templates/")) def render(filename, vars): web.header("Content-Type","text/html; charset=utf-8") tmpl = jinja_env.get_template(filename + '.tmpl') print tmpl.render(vars) - web.debug(web.ctx) + print web.ctx # the url map for the application urls = ( '/?', 'index', @@ -222,5 +225,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()))