1. Daniel Holth
  2. flickzeug

Commits

s0undt3ch  committed 2230be6

Rename `filter` to `exclude`, a less ambiguous name to what it's meant for.

  • Participants
  • Parent commits 5ade7ed
  • Branches default

Comments (0)

Files changed (1)

File flickzeug/leakfinder/leak.py

View file
     To only count("leak find") your own package code::
 
         from flickzeug.leakfinder.leak import LeakFinder
-        app = LeakFinder(app, filter=lambda v: not v.startswith("myproj."))
+        app = LeakFinder(app, exclude=lambda v: not v.startswith("myproj."))
 
     :copyright: (c) 2009 by the Flickzeug Team, see AUTHORS for more details.
     :license: BSD, see LICENSE for more details.
     """
 
     def __init__(self, app, app_path='/_leakfinder', period=5, maxhistory=300,
-                 async_ajax=False, filter=None):
+                 async_ajax=False, exclude=None):
         WebMiddleware.__init__(self, app, app_path)
         self.period = period
         self.maxhistory = maxhistory
         self.async_ajax = async_ajax
-        self.filter = filter
+        self.exclude = exclude
         self.running = False
         self.history = {}
         self.samples = 0
         for objtype, count in typecounts.iteritems():
             typename = objtype.__module__ + "." + objtype.__name__
             if typename not in self.history:
-                if self.filter and self.filter(typename):
+                if self.exclude and self.exclude(typename):
                     continue
                 self.history[typename] = [0] * self.samples
             self.history[typename].append(count)