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

Class GzipWSGIFilter

source code


Compresses content using gzip.

Instance Methods [hide private]
 
__init__(self, flush=True)
This constructor does nothing and can safely be overwritten.
source code
{str: str}
filter_environ(self, environ)
BaseWSGIFilter interface
source code
(str, str) or None
filter_header(self, headername, headervalue)
BaseWSGIFilter interface
source code
[(str, str)]
filter_headers(self, headers)
BaseWSGIFilter interface
source code
bytes
filter_data(self, data)
For each string that is either written by the write callable or returned from the wrapped wsgi application this method is invoked.
source code
gen([bytes])
append_data(self)
This function can be used to append data to the response.
source code

Inherited from BaseWSGIFilter: filter_exc_info, 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, flush=True)
Returns a function creating GzipWSGIFilters.
source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

creator(cls, flush=True)
Class Method

source code 

Returns a function creating GzipWSGIFilters.

Parameters:
  • flush (bool) - whether or not the filter should always flush the buffer

__init__(self, flush=True)
(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:
  • flush (bool) - whether or not the filter should always flush the buffer
Overrides: object.__init__

filter_environ(self, environ)

source code 

BaseWSGIFilter interface

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

filter_header(self, headername, headervalue)

source code 

BaseWSGIFilter interface

Parameters:
  • headervalue (str)
  • headername (str)
Returns: (str, str) or None
Overrides: BaseWSGIFilter.filter_header

filter_headers(self, headers)

source code 

BaseWSGIFilter interface

Parameters:
  • headers ([(str, str)])
Returns: [(str, str)]
Overrides: BaseWSGIFilter.filter_headers

filter_data(self, data)

source code 

For each string that is either written by the write callable or returned from the wrapped wsgi application this method is invoked. It must return a string.

Returns: bytes
Overrides: BaseWSGIFilter.filter_data
(inherited documentation)

append_data(self)

source code 

This function can be used to append data to the response. A list of strings or some kind of iterable yielding strings has to be returned. The default is to return an empty list.

Returns: gen([bytes])
Overrides: BaseWSGIFilter.append_data
(inherited documentation)