[TransWarp] More PWT Ideas (usage, not terminology!)

Roché Compaan roche at upfrontsystems.co.za
Fri Jul 25 05:46:41 EDT 2003

* Phillip J. Eby <pje at telecommunity.com> [2003-07-23 15:03]:
> >I am not sure if this fits in with what
> >DOMlets are supposed to do - I must get my hands dirty with the code
> >first. Have you checked in any of code for DOMlets yet?
> Yes.  See 'peak.web.templates'.  I haven't done the renaming yet, so look 
> for classes like TemplateLiteral (for non-element nodes) and 
> TemplateElement as the base DOMlet classes.  TemplateDocument is a 
> TemplateElement that can be parsed from an XML stream, and that has no 
> open/close tags.  TemplateReplacement is a base for DOMlets that don't 
> render their original contents (like the "list" and "text" 
> DOMlets).  TemplateText and TemplateList are the initial implementations of 
> the "text" and "list" DOMlets.  The whole thing, including a custom 
> expat-driven parser, is about 600 lines of Python.

I attempted to have a go at some DOMlets last night, but realised there
is no way I can get into it quickly. I haven't spent time with the code
in such a long time and I haven't studied PyProtocols yet so I admit I
have some catchup to do.

I don't mind sweating through the code if I have a feeling it will pay
off (which I do with PEAK) but I had the expectation that it would be
easy to make DOMlets and that it doesn't require so much knowledge of
the framework.

The unit test for templates was my starting point and walking through
the code with the python debugger felt like following a trail down a
rabbit hole.

What I specifically don't understand is how the heck a DOMlet finds its
execution context and generally how a WebTraversable, Interaction,
TemplateDocument and its DOMlets fits together. Conceptually I
understand what each of these classes should do, but I don't understand
how these classes connect in the implementation. Some kind of map or
diagram will help though or maybe just a small DOMlet recipe. This is
not a call for documentation just some pointers to help me get going
to make comments on the implementation possible. 

Roché Compaan
Upfront Systems                 http://www.upfrontsystems.co.za

More information about the PEAK mailing list