On 1/15/06, David Bernard <[EMAIL PROTECTED]> wrote:
> When failed Widgets are displayed as string :
>   <generator object at 0xb75e214c>
>
> Cause:
> - ------
> Lake of specification for Widgets.insert() method (and same for
> TemplatePlugin.transform()).
> "...the output is ElementTree Elements..."
>
> So my implementation, I translate this into :
> * a ElementTree.Element
> * or a list/tuple of ElementTree.Element
>
> But for kid return a "generator" (or stream into kid'api)
>
> Suggestions:
> - ------------
> * details the api and be provide tools for simple integration with
> TemplatePlugin implementation
> * the return of methods, is a ElementTree.Element or a list/tuple of
> ElementTree.Element, then I suggest to patch TurboKid (see below for a
> basic patch, maybe optimisation are possible when widget and page use
> the same template engine). This solution remove from each engine to have
> special traitement for kid.

There has been talk of having a template plugin base class. That could
implement the transform method (basically parsing out the rendered
result into Elements). Of course, many template engines aren't going
to produce valid XML. Maybe the better way to go is have
widget.insert() call template engine.transform if available or call
XML(render())

Kevin

Reply via email to