class SaveEnviron(object): """Pass the WSGI environ to a function on every request.""" def __init__(self, app, func): self.app = app self.func = func def __call__(self, environ, start_response): self.func(environ) return self.app(environ, start_response)