[Baypiggies] Output generation - (string operations/triple quote/template)

Chris Clark Chris.Clark at ingres.com
Wed Feb 28 20:31:26 CET 2007

Tung Wai Yip wrote:
> On Wed, 28 Feb 2007 10:55:31 -0800, Chris Clark 
> <Chris.Clark at ingres.com> wrote:
>> After lots of experimentation I ended up using
>> http://freespace.virgin.net/hamish.sanderson/htmltemplate.html - one
>> thing that annoys me slightly about HTMLTemplate is that you have to
>> write code to populate the template. I was able to get around that in a
>> few projects by writing a generic routine to take in a dictionary (like
>> most templating systems). For the few times that I couldn't use my
>> generic dict system I ended up with a routine (or routines) that have 1
>> line per item to be replaced in the template. For large numbers of
>> elements this was easy to maintain, if you have very few elements this
>> actual is frustrating and you wonder why you used a template :-)
> I'm a happy user of HTMLTemplate too. Is your enhancement generic 
> enough to contribute back to the project?

I did send it back, as it required some a minor change to be made to 
HTMLTemplate. I got a response back that a new version (v2) will be 
coming out with a slightly different api. The new version will closely 
model the TextTemplate (same web site). I'm not clear if my code was 
accepted though :-)

I'm happy to share my "uses dicts" change, if anyone is interested just 
drop me a mail (it is only a small tar ball).


More information about the Baypiggies mailing list