]> projects.mako.cc - yourule/commitdiff
merged in jinja template move
author<mako@atdot.cc> <>
Sun, 16 Sep 2007 20:55:02 +0000 (16:55 -0400)
committer<mako@atdot.cc> <>
Sun, 16 Sep 2007 20:55:02 +0000 (16:55 -0400)
1  2 
yourule.py

diff --cc yourule.py
index c5ffdb7eeed914f187daf138d4cb31eee49c6dc4,9e933d667a8959610c8883962b37fbce15d9e9d6..3de9e7b4f03cd56323f730adf4fa1d0bbd37e6ca
@@@ -6,8 -6,18 +6,18 @@@ import sys, os, r
  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',

Benjamin Mako Hill || Want to submit a patch?