[Cheetahtemplate-discuss] Unwanted automatic discovery of Webware/WebKit
- I have a web application running out of Webware for Python. I use PSP
for my page templates because I hadn't discovered Cheetah when I started
the project. My application lets users write questionnaires that
include fragments of python code and fragments of text that is templated
via Cheetah. When I want to display text that may include variables
references, I manually construct a Template object and evaluate it.
This used to work fine (Cheetah 0.9.15), but now I get an error:
NotImplementedError: couldn't find the template's main method. If you are using #extends
without #implements, try adding '#implements respond' to your template
A bit of looking around revealed that this occurs because Cheetah
detects that WebKit.Servlet is in sys.path and assumes that any Template
objects being instantiated must be Webware servlets!
I wonder whether it might not be better to require Webware users to opt
in to this functionality, but perhaps this will cause too much trouble
for existing users. If so then it would seem reasonable to be able to
opt out. Unfortunately I cannot think of a way to do this because the
WebKit detection code runs as Servlet.py is first imported and I think
that afterwards it is too late to fix it. I currently work around this
by fiddling the the code in Servlet.py on each of my hosts.
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
Cheetahtemplate-discuss mailing list