kaegi / MorphMan

Anki plugin that reorders language cards based on the words you know
Other
262 stars 66 forks source link

Exception: got multiple values for argument '_old' #155

Closed DoctorDjex closed 3 years ago

DoctorDjex commented 4 years ago

Hi,

There was a card I wanted to review but Morphman would not let me do it (raises an error, but I think you already know this feature does not work). So I manually rescheduled the card to start learning it.

But now if click on the "study now" button I got this.

Caught exception: Traceback (most recent call last): File "aqt\webview.py", line 35, in cmd File "aqt\webview.py", line 121, in _onCmd File "aqt\webview.py", line 536, in _onBridgeCmd File "aqt\overview.py", line 67, in _linkHandler File "aqt\main.py", line 647, in moveToState File "aqt\main.py", line 669, in _reviewState File "aqt\reviewer.py", line 65, in show File "aqt\reviewer.py", line 110, in nextCard File "lib\site-packages\anki\schedv2.py", line 62, in getCard File "lib\site-packages\anki\sched.py", line 172, in _getCard File "<C:\Program Files (x86)\Anki\decorator.pyc:decorator-gen-6>", line 2, in _getNewCard File "lib\site-packages\anki\hooks.py", line 638, in decorator_wrapper File "lib\site-packages\anki\hooks.py", line 635, in repl File "C:\Users\cyril\AppData\Roaming\Anki2\addons21\900801631\morph\newMorphHelper.py", line 98, in my_getNewCard card = _old(self) # type: anki.cards.Card File "lib\site-packages\anki\schedv2.py", line 328, in _getNewCard File "<C:\Program Files (x86)\Anki\decorator.pyc:decorator-gen-2>", line 2, in _fillNew File "lib\site-packages\anki\hooks.py", line 638, in decorator_wrapper File "lib\site-packages\anki\hooks.py", line 635, in repl TypeError: my_fillNew() got multiple values for argument '_old'

I love this addon, but this is really a pain the feature to start immediately a review does not work. So I may enable Morphman only for the recalc feature and disable it the rest of the time.

Thank you all for your help on this problem.

MichalMichalak commented 4 years ago

This happened to me, as well, after upgrading Anki from 2.1.26 to 2.1.28.

sourstripe commented 4 years ago

Having the same issue, also with 2.1.28. can't look at new cards

michelle-joudrey commented 4 years ago

+1

michelle-joudrey commented 4 years ago

I was able to work around it, at least I think, by changing this line in newMorphHelper.py from

sched.Scheduler._fillNew = wrap(sched.Scheduler._fillNew, my_fillNew, 'around')

to

original_fillNew = sched.Scheduler._fillNew
def my_fillNewWrapper(self):
    return my_fillNew(self, _old=original_fillNew)

sched.Scheduler._fillNew = my_fillNewWrapper
sourstripe commented 4 years ago

@rjoudrey that seems to have solved it for me too. I use the v2 scheduler, so I just added a v2 to everything and it works

landonepps commented 4 years ago

I actually fixed this for 2.1.29 but didn't realize it was an issue in 2.1.28, too The problem is _fillNew added a new parameter. I feel like the API is changing every point release recently... 😅 Here's the fix: https://github.com/landonepps/MorphMan21/commit/827caadfe9ba1213877baf1c1540c69b339a0e41

WaiYanMyintMo commented 3 years ago

Is this still an issue?

DoctorDjex commented 3 years ago

No at least this is good now. Hoping the "learn now" feature get solved also one day.