[Twisted-Python] DOMTemplate best practice
Mario Ruggier
mario at ruggier.org
Fri Jan 17 12:24:10 EST 2003
Hello,
I am playing with the examples and howtos, to try and figure some of
this thing out.
The DOMTemplate HowTo goes through a simple example, and uses 3 files,
one for
the template itself, one for a resource that sits next to the template
file, and one for the
code that actually instantiates the template (and this one must be put
in the pythonpath).
My question is that, given that this 3rd file (webquoteresource.py in
this example) is anyhow
dedicated to this template (and will always be, given that the method
names must match
hook names in the template), why is it kept separate and not part of
the rpy itself?
Thanks, mario
ps; btw, this example if full of errors, namely:
- webquoteresource.py:
from TwistedQuotes import quoters (no quoters...)
templateFile = "WebQuotes.xhtml" (never used, and filename non-existant)
- webquote.rpy:
#get the sibling file "quotes.txt" (no such "quotes.txt" file ...)
quotefile = os.path.join(os.path.split(__file__)[0], "quotes.txt")
- clicking on "See it in action" gives error...
More information about the Twisted-Python
mailing list