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

Class TimerWSGIFilter

source code


Replaces a specific string in the data returned from the filtered wsgi application with the time the request took. The string has to be exactly eight bytes long, defaults to "?GenTime" and must be an element of the iterable returned by the filtered application. If the application returns something like ["spam?GenTime", "?GenTime spam", "?GenTime"] only the last occurance get's replaced.

Instance Methods [hide private]
 
__init__(self, pattern='?GenTime')
This constructor does nothing and can safely be overwritten.
source code
bytes
filter_data(self, data)
BaseWSGIFilter interface
source code

Inherited from BaseWSGIFilter: append_data, filter_environ, 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, pattern)
Returns a function creating TimerWSGIFilters with a given pattern beeing a string of exactly eight bytes.
source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

creator(cls, pattern)
Class Method

source code 

Returns a function creating TimerWSGIFilters with a given pattern beeing a string of exactly eight bytes.

Parameters:
  • pattern (bytes)

__init__(self, pattern='?GenTime')
(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:
  • pattern (str)
Overrides: object.__init__

filter_data(self, data)

source code 

BaseWSGIFilter interface

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