[Baypiggies] Grok and Plone

Keith Dart ♂ keith at dartworks.biz
Sun Feb 3 04:45:12 CET 2008

Donna Snow wrote the following on 2008-02-02 at 19:20 PST:
> Please keep an eye on Plone.. not only is it growing.. but there is
> talk of making it much, much easier to use.. and faster :-) Lots of
> talk about WSGI and "Deliverance" which will improve the templating
> story for Plone.

That's nice, it needs it. ;-) I tried using it once... or twice. 

Then I started using Django. It's ok...

But WSGI is cool, and I now prefer the component model of WSGI, using
Pylons and flup and some of my own stuff. My own stuff also works with
lighttpd as the front-end, and it even configures it for you so you
don't have to deal with that (does virtual hosting, too).

A simple example of it is here:


This is implemented in about 60 lines of pure Python code, and no
templates, or writing of XHTML tags of any kind (but some CSS). 

Flexibility is its primary feature.

The main parts of this page is entirely constructed by this code:

# Request handlers creates response document, returns finalized form.
def headers(request):
    resp = framework.ResponseDocument(request, doc_constructor, 
	title="Request Headers")
    get_header_table(resp.doc, request.META)
    return resp.finalize()

# callback to render a cell
def renderval(d, NM, key):
    return repr(d[key])

# create a table and add it to the response document
def get_header_table(doc, environ):
    # create dictionary of header names and values.
    d = dict([(k[5:].replace("_", "-").capitalize(), v) 
		for k, v in environ.items() if k.startswith("HTTP")])
    # Add new XHTML table with its contents.
    tbl = doc.new_table(d.keys(), [curry(renderval, d)], ("HTTP Headers",))
    tbl.width = "100%"

-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Keith Dart <keith at dartworks.biz>
   public key: ID: 19017044

More information about the Baypiggies mailing list