From 8603cef047ae1c892f862535ec36da2eb429c2fd Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Wed, 1 Jun 2011 15:18:07 +0200 Subject: improved doc string for middlewares.ContentLengthMiddleware --- wsgitools/middlewares.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'wsgitools') diff --git a/wsgitools/middlewares.py b/wsgitools/middlewares.py index 2b6b51b..709304f 100644 --- a/wsgitools/middlewares.py +++ b/wsgitools/middlewares.py @@ -118,11 +118,12 @@ class ContentLengthMiddleware: @note: The application used must not use the C{write} callable returned by C{start_response}.""" def __init__(self, app, maxstore=0): - """Wraps wsgi application app. It can also store the first result bytes - to possibly return a list of strings which will make guessing the size - of iterators possible. At most maxstore bytes will be accumulated. - Please note that a value larger than 0 will violate the wsgi standard. - The magical value C{()} will make it always gather all data. + """Wraps wsgi application app. If the application returns a list, the + total length of strings is available and the content length header is + set unless there already is one. For an iterator data is accumulated up + to a total of maxstore bytes (where maxstore=() means infinity). If the + iterator is exhaused within maxstore bytes a content length header is + added unless already present. @type maxstore: int or () @note: that setting maxstore to a value other than 0 will violate the wsgi standard -- cgit v1.2.3