mwh's blog for 2007 April 9 (entry 0)

< EuroPython 2007: Call for Proposals
pydoctor convenience >

some nevow silliness: I have an application (pydoctor) that uses nevow for its html generation. One of the newer classes uses a big "loaders.stan" for its docFactory, and this was getting a bit unwieldy so I wanted to switch to using loaders.xmlfile. But that meant I had to convert the stan expression into a template, which seemed like it would be pretty boring. So I hacked instead, and wrote an implementation of nevow.inevow.IRendererFactory that, when the stan is rendered, produces as output xml suitable for use with loaders.xmlfile.

The (fairly insane in places) code is here. For an example of what it does, it turns this into this. It doesn't support slots or patterns or ..., just those things I needed so far. It says something for nevow that this is even remotely possible :-)

As I've been learning bzr recently, I've made http://python.net/crew/mwh/hacks/stan2xml/ a bzr branch. Try bzr branch http://python.net/crew/mwh/hacks/stan2xml/.

Filed under:


[Main]

Unless otherwise noted, all content licensed by Michael Hudson
under a Creative Commons License.