wsgistraw 0.1.2
Decorators for WSGI without start_response and write
wsgistraw (WSGI without STart_Response And Write) is a tiny Python library that simplifies coding WSGI applications and middleware by removing start_response and write from signatures of functions. This leads to a signature like:
def app(environ):
return "200 OK", [("Content-Type", "text/plain")], ["Hello World!"]
That is, return a three-tuple of (status, headers, response).
start_response and write are very annoying in WSGI middleware. wsgistraw makes your middleware code cleaner. This is an example of a "lowercase" middleware factory:
@wsgistraw.mid_factory
def lowercase(app):
def mid(environ):
status, headers, response = app(environ)
return status, headers, (s.lower() for s in response)
return mid
What's New
A bugfix release. Fixed a bug in app_proxy with extending an iterable with the results of write().
| File | Type | Py Version | Uploaded on | Size | # downloads |
|---|---|---|---|---|---|
| wsgistraw-0.1.2-py2.4.egg (md5) | Python Egg | 2.4 | 2007-09-21 21:50:22 | 5KB | 313 |
| wsgistraw-0.1.2.zip (md5) | Source | 2007-09-21 21:50:12 | 16KB | 180 | |
- Author: Andrey Nordin
- Home Page: http://abstracthack.wordpress.com/wsgistraw
- Keywords: wsgi decorator start_response write
- License: GNU LGPL
-
Categories
- Development Status :: 4 - Beta
- Environment :: Web Environment
- Intended Audience :: Developers
- License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
- Operating System :: OS Independent
- Programming Language :: Python
- Topic :: Internet :: WWW/HTTP :: WSGI
- Topic :: Software Development :: Libraries
- Package Index Owner: anrienord
- DOAP record: wsgistraw-0.1.2.xml
Log in to rate this package.
