I'm trying to create a library of Kid snippets and not having much joy. [Kid hasn't brought me much joy, but as it represents the default templating system for TG, and I'm writing a TG-based sample for an Ajax book, it seems reasonable to use Kid. Reasonable but annoying.]I have the following two files in my templates folder: master.kid and snippets.kid. The snippets file has a number of py:def constructs that I'd like to use throughout my app (including pages that don't inherit from master.kid).I'm following the recommendation on the Kid site:But it just doesn't work.I've tried putting all of the following at the top of master.py:<?python from shop.templates.snippets import * ?><?python import snippets ?><?python from snippets import * ?>But none of these work. The stack trace reports: ImportError: No module named snippetsUndoubtedly because snippets.kid has never been turned into snippets.py (there's no corresponding pyc file in the folder).Does anyone know how to make this work?
If snippets.kid is in the same directory as master.kid you should just be able to 'import snippets'. You can also use the filename in py:extends instead. Something like py:extends="'snippets.kid'".
Also you may want to check to see if you have proper __init__.py files.
-- David

