[Htmltmpl] Trailing empty line while printing template
Brought to you by:
jakubvrana,
tripiecz
|
From: Johan S. <jo...@sv...> - 2003-12-23 14:19:27
|
Hi!
First of all, thanks for making htmltmpl, it's great!
Now to the subject. I've written a small thingie in Python were my
template looks like this:
<p><a href="<TMPL_VAR channel_link>"><TMPL_VAR channel_title></a></p>
<ul>
<TMPL_LOOP Items>
<li><a href="<TMPL_VAR link>"><TMPL_VAR title></a></li>
</TMPL_LOOP>
</ul>
When I print the proccessed template like this:
print tp.process(tm)
The result comes out just fine, however, there is a mysterious trailing
empty line (which isn't in the template file) that's also printed.
Although the empty line goes away when I instead write the output to a
file with the following code:
def write_template(self, output):
try:
f = open(output, "w")
try:
f.write(tp.process(tm))
finally:
f.close()
except Exception, e:
sys.exit(e)
Does someone know what's going on here?
PS. Please Cc me since I'm not subscribed, thanks.
--
Johan Svedberg, jo...@sv..., http://johan.svedberg.pp.se/
|