mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 16:02:23 -04:00
allow arbitrary number of args in filters
This commit is contained in:
parent
9d8df81e11
commit
b5da38474f
1 changed files with 2 additions and 2 deletions
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue