Commits

Anonymous committed ed9e27c

Rename the profiler filtering function to a name that makes more sense.

Comments (0)

Files changed (1)

flickzeug/profiling/profiler.py

                               pickled to. If not provided, a temporary directory
                               will be created and used.
     :param app_path: the url path where the stats will be served from.
-    :param should_profile: a function which should return True or False. If True
+    :param profile_filter: a function which should return True or False. If True
                            the request is profiled. The function must accept an
                            argument, the environ. Use this to filter the
                            requests you wish to profile.
     """
 
     def __init__(self, app, profile_data_path, app_path='/_profiler',
-                 should_profile=None):
+                 profile_filter=None):
         WebMiddleware.__init__(self, app, app_path)
         self.profile_path = profile_data_path
-        self.should_profile = should_profile
+        self.profile_filter = profile_filter
         self.handlers = {
             'index':      self.show_all,
             'show':       self.show,
         return [body]
 
     def subdispatch_wsgi(self, environ, start_response):
-        if self.should_profile and self.should_profile(environ.copy()):
+        if self.profile_filter and self.profile_filter(environ.copy()):
             return self._profile(environ, start_response)
         return self.app(environ, start_response)