I’m passing 2 arguments to the reviewer_did_answer_card hook, (self and _old), however, if I try to run this function, Anki passes a third argument to it and doesn’t run my function. It says 'it expected 2 arguments but 3 were given (even if i’m only passing 2). Does anyone know how to solve this?
This is my hook:
gui_hooks.reviewer_did_answer_card.append(function)
This is my function
def ColdTurkey(self, _old):
ret = _old(self)
# code
return ret
And this is the error log Anki is giving me:
Caught exception:
Traceback (most recent call last):
File "aqt\webview.py", line 36, in cmd
File "aqt\webview.py", line 135, in _onCmd
File "aqt\webview.py", line 580, in _onBridgeCmd
File "aqt\reviewer.py", line 343, in _linkHandler
File "aqt\reviewer.py", line 271, in _answerCard
File "aqt\hooks_gen.py", line 2279, in __call__
TypeError: ColdTurkey() takes 2 positional arguments but 3 were given