Package wsgitools :: Module filters :: Class ReusableWSGIInputFilter
[hide private]
[frames] | no frames]

Class ReusableWSGIInputFilter

source code


Make environ["wsgi.input"] readable multiple times. Although this is not required by the standard it is sometimes desirable to read wsgi.input multiple times. This filter will therefore replace that variable with a BytesIO instance which provides a seek method.

Instance Methods [hide private]
 
__init__(self, maxrequestsize=65536)
ReusableWSGIInputFilters constructor.
source code
{str: str}
filter_environ(self, environ)
BaseWSGIFilter interface
source code

Inherited from BaseWSGIFilter: append_data, filter_data, filter_exc_info, filter_header, filter_headers, filter_status, handle_close

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
 
creator(cls, maxrequestsize)
Returns a function creating ReusableWSGIInputFilters with desired maxrequestsize being set.
source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

creator(cls, maxrequestsize)
Class Method

source code 

Returns a function creating ReusableWSGIInputFilters with desired maxrequestsize being set. If there is more data than maxrequestsize is available in wsgi.input the rest will be ignored. (It is up to the adapter to eat this data.)

Parameters:
  • maxrequestsize (int) - is the maximum number of bytes to store in the BytesIO

__init__(self, maxrequestsize=65536)
(Constructor)

source code 

ReusableWSGIInputFilters constructor.

Parameters:
  • maxrequestsize (int) - is the maximum number of bytes to store in the BytesIO, see creator
Overrides: object.__init__

filter_environ(self, environ)

source code 

BaseWSGIFilter interface

Parameters:
  • environ ({str: str})
Returns: {str: str}
Overrides: BaseWSGIFilter.filter_environ