I noticed a useful sounding environment variable called "KID_OUTPUT_PY",
which will generate the python source code files for compiled templates,
but when I set it, it didn't have any effect. I rooted around to find
out why, and came up with this patch to make it work, by passing it in
from the place that the template compiler is actually being called from
kid's __init__.py load_template function (line 118):

        code = template.compile(dump_code=cache,
dump_source=os.environ.get('KID_OUTPUT_PY'))

It's quite interesting to look at the compiled templates, and it
certainly helps in debugging syntax errors. 

        -Don


Reply via email to