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
str
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

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
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 (str)

__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: BaseWSGIFilter.__init__

filter_data(self, data)

source code 

BaseWSGIFilter interface

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