[PEAK] Does a PEAK-ized webware esist ?
Ian Bicking
ianb at colorstudy.com
Fri Jan 30 17:40:59 EST 2004
Phillip J. Eby wrote:
> At 03:58 PM 1/30/04 -0600, Ian Bicking wrote:
>
>> Wayne Larsen wrote:
>>
>>> That is what I was looking at -- I was trying to understand how
>>> peak.web maps from a url to an actual resource, since I have a
>>> feeling the solution I'm looking for is some combination of the two.
>>
>>
>> Well, if you are running PEAK (or peak.web, I suppose) inside Webware,
>> then you'll want a URLParser that delegates to PEAK's URL parsing.
>
>
> For 'peak.web', it's not really PEAK's URL parsing. 'peak.web' uses
> Zope X3 request and response objects, so it's probably not going to live
> happily inside of Webware.
Really? It's been a while since I looked at those objects, but it seems
like it should be possible to subclass them so they delegate to
Webware's request and response instead of reading out of
stdin/stdout/environ. Environ is already present, and I believe Zope's
HTTPRequest.__init__ is close enough to Webware's HTTPRequest.__init__
that you could map the resulting internal data structures. And Zope's
HTTPResponse, if I remember, is pretty simple.
I don't know about traversal, but I don't know why it wouldn't be
doable. URLParser returns a Webware servlet, not a path to a file, so
the wrapper only has to wrap the Zope object in a servlet.
> That doesn't mean you can't have PEAK components inside of Webware, just
> that 'peak.web' isn't going to be able to do traversals in there, unless
> you can bridge back to a WSGI-style 'runCGI()' call.
That might be an interesting feature, i.e., to wrap the response in a
stdout-like object, and serialize the request back into a stdin-like
object, and rewrite a couple environmental variables to represent the
new context.
Ian
More information about the PEAK
mailing list