instrumentation: add next-share/
[cs-p2p-next.git] / instrumentation / next-share / BaseLib / Core / BitTornado / BT1 / Filter.py
1 # Written by Bram Cohen
2 # see LICENSE.txt for license information
3
4 class Filter:
5     def __init__(self, callback):
6         self.callback = callback
7
8     def check(self, ip, paramslist, headers):
9
10         def params(key, default = None, l = paramslist):
11             if l.has_key(key):
12                 return l[key][0]
13             return default
14
15         return None