Python Template Weblog

May 30, 2005

Functioning CGI back-end and interface

Filed under: Meta, Back-End — Tim @ 11:27 am

I worked on the back-end code and the interface to the template systems a good deal this weekend, and have managed to get them to a point where I like them. If I may say so, the interface is very pythonic, in that it’s highly dynamic. At this point, I have a working CGI script and a good class hierarchy for both view objects and template engines, and I think I’ve hit a nice balance between over-engineering the interface and making the code easy to use and extend.

As a test, I’ve implemented a simple pager in kid and PyMeld. The pager is a nice component because it’s so simple (with a view object consisting of two integers), but it seems like a good way to get a feel for a given template engine. I’m considering writing a pager in each system as a sort of sneak peek at each one before getting more in-depth with each engine in turn. That will also give me some time to get feedback from various template authors.

At this point I am going to need to write up the back-end, massage the code into something a little more releasable, and install it on my hosting provider. I want to reorganize the weblog layout a bit too. After that I’ll be ready to start publicizing this site.

May 27, 2005

Progress on the back end

Filed under: Meta, Back-End — Tim @ 10:35 pm

Having finished mocking up a few pages, I’m now concentrating on writing a very lightweight CGI script to test the various python engines. Amusingly, I’m finding myself wishing for a template system as I do it - what I have now is a very simple one based on open(fname).read() % data. I am strenuously resisting writing up my own template engine to run the comparison.

I’m doing this in CGI because my cheap (but good) web hosting provider won’t let me run long-running processes such as Quixote, Twisted, etc, and frankly I’ve already got enough poorly-organized documentation to read with the template engines; adding web framework documentation to the pile would probably drive me utterly insane.

In entirely unrelated news, my small patch for the Python syntax highlighter in GeSHi will be included in their next release.

Once I do a little more hacking, I’ll go back to working on the sample pages page and then start documenting the back end. One problem I’ve run into is that I won’t quite know what the back end needs to contain until I start templatizing the sample pages, but maybe it will be better to write the presentation objects before the I get into those nitty-gritty details.

May 26, 2005

More meta

Filed under: Meta — Tim @ 4:23 pm

Well, typically, I’ve spent lots of time on something utterly unrelated to the topic I’m allegedly concentrating on here. In this case that consists of tweaking my WordPress installation and making some changes to the GeSHi syntax highlighter to produce python code which is more appealing to mine eye.

If anyone is interested in the changes, you can look at the brief samples and download page I created. I’ve also added them as a feature request at GeSHi’s sourceforge page, so hopefully they’ll be in the next stable release.

In the meantime, I’m working on some sample pages to use for the templating tasks. Hopefully more will be done soon and I can get started on the next story.


[skreak.com] Powered by WordPress. Theme based on Parishudda by H P Nadig.