Titus Brown wrote:
> pursuant to my Quixote2 tutorial and a private request, I've updated
> my WSGI wrapper for Quixote to work for Quixote 2.0.  It's been greatly
> simplified in the process.
>
> It's called QWIP2, and there's a not-very-updated Web page here:
>
>       http://www.idyll.org/~t/www-tools/wsgi/
>
> The source is directly available here:
>
>       http://darcs.idyll.org/~t/projects/qwsgi/quixote2/qwip2.py

Thanks!  I tried it with WSGI Utils' HTTP server and Quixote's Demo and
Altdemo and it works fine.  It can be simplified further, however, by
getting the headers and body from the response object directly rather than
parsing the formatted output.  See attached qwip2.py:
  - Inlined response.write() code and eliminated string parsing.
  - Removed .send_headers() -- now obsolete.
  - Removed .close() -- stray from earlier implementation?
  - Added .check_headers(), which verifies the headers are WSGI compliant.
    The only check currently is that 'Transfer-Encoding' is not present.
    This would get set if the application calls response.set_body(body,
    compress=True).  PEP 333 says applications should never compress or
    encode the body; that's the web server's responsibility.  We could also
    canonicalize headers here or add missing headers.  (PEP 333 mentions
    Date: and Server:, although we can punt those to the web server.)
    Raises RuntimeError if validation fails; perhaps there's a better way.
    Checking is bypassed if global flag PEDANT is false.

Also attached is a small program to run Quixote's Demo or Altdemo through
WSGI Utils' HTTP server.

-- Mike Orr <[EMAIL PROTECTED]>

Attachment: qwip2.py
Description: Binary data

Attachment: qwip2-test.py
Description: Binary data

_______________________________________________
Quixote-users mailing list
[email protected]
http://mail.mems-exchange.org/mailman/listinfo/quixote-users

Reply via email to