DocumentTemplates -> static pages
Is anyone using DocumentTemplate to create static html pages? I'm using it to create dynamic pages, but it's not obvious (unless I look through the source) how I would write the contents directly to an html file (i.e. without producing quote conversions: <html> to: <html>) I could unquote the output, but that seems like extra work. -Jeff
On Wed, 28 Jul 1999, Jeff Bauer wrote:
Is anyone using DocumentTemplate to create static html pages? I'm using it to create dynamic pages, but it's not obvious (unless I look through the source) how I would write the contents directly to an html file (i.e. without producing quote conversions: <html> to: <html>) Call it ;) dt=DocumentTemplate(...) dt(self,arg1=val1)
Hopefully I've remembered right from by Bobo days ;) Andreas -- Andreas Kostyrka | andreas@mtg.co.at phone: +54/1/7070750 | phone: +43/676/4091256 MTG Handelsges.m.b.H. | fax: +43/1/7065299 Raiffeisenstr. 16/9 | 2320 Zwoelfaxing AUSTRIA
Andreas, My quick solution was to write an unescape function and invoke it prior to writing the template values. def unescape(s): s = string.replace(s, """, '"') s = string.replace(s, "<", "<") s = string.replace(s, ">", ">") s = string.replace(s, "&", "&") return s e.g.: f.write(unescape("%s\n" % myDT)) I hope I'm not doing this the hard way. -Jeff Andreas Kostyrka wrote:
Is anyone using DocumentTemplate to create static html pages? I'm using it to create dynamic pages, but it's not obvious (unless I look through the source) how I would write the contents directly to an html file (i.e. without producing quote conversions: <html> to: <html>)
Call it ;) dt=DocumentTemplate(...) dt(self,arg1=val1)
Hopefully I've remembered right from by Bobo days ;)
On Wed, 28 Jul 1999, Jeff Bauer wrote:
Andreas,
My quick solution was to write an unescape function and invoke it prior to writing the template values.
def unescape(s): s = string.replace(s, """, '"') s = string.replace(s, "<", "<") s = string.replace(s, ">", ">") s = string.replace(s, "&", "&") return s
e.g.: f.write(unescape("%s\n" % myDT))
I hope I'm not doing this the hard way. You are ;)
After studying the source, the solution below should work:
Call it ;) dt=DocumentTemplate(...) dt(self,arg1=val1)
Hopefully I've remembered right from by Bobo days ;)
-- Andreas Kostyrka | andreas@mtg.co.at phone: +54/1/7070750 | phone: +43/676/4091256 MTG Handelsges.m.b.H. | fax: +43/1/7065299 Raiffeisenstr. 16/9 | 2320 Zwoelfaxing AUSTRIA
participants (2)
-
Andreas Kostyrka -
Jeff Bauer