[Twisted-web] IRenderer interface for Nevow
matt at pollenation.net
Sun Apr 4 18:40:11 MDT 2004
While testing out an idea, I noticed that I was implementing
IRendererFactory just to turn a class instance into a renderer. For
__implements__ = ISummaryView, IRendererFactory
def __call__(self, context, data):
That didn't make sense to me and I also had no reason to add
IRendererFactory's renderer() method.
I then noticed that quite a few classes (freeform in particular) that
implement IRendererFactory were actually just renderers and didn't have
or need a renderer() method either.
So ... I created a IRenderer marker interface and changed most uses of
IRendererFactory to IRenderer. See the attached diff (against svn
trunk). It seems to work (i.e. no more tests fail than usual ;-)) but I
didn't want to commit it without some feedback first.
You'll notice that a couple of test_flatstan tests changed slightly to
make them pass. I don't think the renderer function signature was
correct in the context but please shout if you can think of a legitimate
reason why it should be supported.
James Knight (aka foom) suggested that IRenderer may not be needed at
all and that adapting anything callable would probably be enough. That
is probably correct but a) it's too early in the morning to think about
it and b) I'd rather make the change it two steps.
OK, let me know what you think to all this.
Matt Goodall, Pollenation Internet Ltd
e: matt at pollenation.net
Any views expressed are my own and do not necessarily reflect
the views of my employer.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 7752 bytes
Desc: not available
Url : http://pyramid.twistedmatrix.com/pipermail/twisted-web/attachments/20040405/bf977d40/irendererfactory_irenderer.bin
More information about the Twisted-web