from storm.locals import *
from svgruler import SVGRuler
+ from jinja import Environment, FileSystemLoader
+ jinja_env = Environment('<%', '%>', '<%=', '%>', '<%#', '%>',
+ loader=FileSystemLoader('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)
+
# 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',