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

Class EncodeWSGIFilter

source code


Encodes all body data (no headers) with given charset.


Note: This violates the wsgi standard as it requires unicode objects whereas wsgi mandates the use of bytes.

Instance Methods [hide private]
 
__init__(self, charset='utf-8')
This constructor does nothing and can safely be overwritten.
source code
bytes
filter_data(self, data)
BaseWSGIFilter interface
source code
(str, str)
filter_header(self, header, value)
BaseWSGIFilter interface
source code

Inherited from BaseWSGIFilter: append_data, filter_environ, filter_exc_info, 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, charset)
Returns a function creating EncodeWSGIFilters with a given charset.
source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

creator(cls, charset)
Class Method

source code 

Returns a function creating EncodeWSGIFilters with a given charset.

Parameters:
  • charset (str)

__init__(self, charset='utf-8')
(Constructor)

source code 

This constructor does nothing and can safely be overwritten. It is only listed here to document that it must be callable without additional parameters.

Parameters:
  • charset (str)
Overrides: object.__init__

filter_data(self, data)

source code 

BaseWSGIFilter interface

Parameters:
  • data (str)
Returns: bytes
Overrides: BaseWSGIFilter.filter_data

filter_header(self, header, value)

source code 

BaseWSGIFilter interface

Parameters:
  • header (str)
  • value (str)
Returns: (str, str)
Overrides: BaseWSGIFilter.filter_header