allow arbitrary number of args in filters

This commit is contained in:
Damien Elmes 2009-06-12 22:21:57 +09:00
parent 9d8df81e11
commit b5da38474f

View file

@ -25,11 +25,11 @@ def runHook(hook, *args):
for func in hook:
func(*args)
def runFilter(hook, arg):
def runFilter(hook, arg, *args):
hook = _hooks.get(hook, None)
if hook:
for func in hook:
arg = func(arg)
arg = func(arg, *args)
return arg
def addHook(hook, func):