From c61d6a6300242da86d532d34bb0506e04c9de658 Mon Sep 17 00:00:00 2001 From: Date: Sun, 16 Sep 2007 17:24:49 -0400 Subject: [PATCH] fixed several bugs --- yourule.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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())) -- 2.39.5