Anki-Night-Mode icon indicating copy to clipboard operation
Anki-Night-Mode copied to clipboard

Conflict with Touch Screen add-on

Open vsheg opened this issue 4 years ago • 0 comments

Problem description

When I click "Study Now" button in deck screen, an error window appears (see traceback). Conflict with Touch Screen add-on. Both of these add-ons have definition revHtml:

  • Touch Screen modifies mw.reviewer.revHtml in __init__.py
  • Night mode has unwanted definition revHtml in stylers.py

Commenting of revHtml in stylers.py with # solved the problem.

Checklist

  • [x] I verified that I use the lastest Anki version,
  • [x] I verified that I use the lastest add-on version,
  • [x] I tried to disable other add-ons to find the culprit,
  • [x] I checked if anyone reported this problem before, as well as Known issues section on add-ons page,
  • [x] My issue is solved when holding shift while starting Anki.

Information about Anki Setup

Version: Anki 2.1.19 (3c8690ae) Python 3.8.0
Qt: Qt 5.14.0 PyQt 5.13.2
Night Mode: 2.3.3 (latest from Ankiweb)
OS: macOS 10.15.2

Backtrace

Error 
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed. 
If the issue only occurs when add-ons are enabled, please use the Tools>Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem. 
When you've discovered the add-on that is causing the problem, please report the issue on the add-ons section of our support site. 
Debug info:
Anki 2.1.19 (3c8690ae) Python 3.8.0 Qt 5.14.0 PyQt 5.13.2
Platform: Mac 10.15.2
Flags: frz=True ao=True sv=2
Add-ons possibly involved: Touch Screen - draw and write on your cards, Night Mode, Review Heatmap
Caught exception:
Traceback (most recent call last):
  File "aqt/webview.py", line 28, in cmd
  File "aqt/webview.py", line 94, in _onCmd
  File "aqt/webview.py", line 407, in _onBridgeCmd
  File "</Applications/Anki.app/Contents/MacOS/decorator.pyc:decorator-gen-40>", line 2, in _linkHandler
  File "anki/hooks.py", line 82, in decorator_wrapper
  File "anki/hooks.py", line 79, in repl
  File "~/Library/Application Support/Anki2/addons21/review_heatmap/links.py", line 74, in heatmapLinkHandler
    return None if not _old else _old(self, url)
  File "aqt/overview.py", line 38, in _linkHandler
  File "aqt/main.py", line 562, in moveToState
  File "aqt/main.py", line 592, in _reviewState
  File "aqt/reviewer.py", line 53, in show
  File "aqt/reviewer.py", line 104, in nextCard
  File "aqt/reviewer.py", line 149, in _initWeb
  File "</Applications/Anki.app/Contents/MacOS/decorator.pyc:decorator-gen-48>", line 2, in custom
  File "anki/hooks.py", line 82, in decorator_wrapper
  File "anki/hooks.py", line 79, in repl
  File "~/Library/Application Support/Anki2/addons21/1496166067/internals.py", line 218, in raw_new
    return wrapper(cls.instance, *args, **kwargs)
  File "~/Library/Application Support/Anki2/addons21/1496166067/stylers.py", line 157, in revHtml
    return _old(reviewer) + style_tag(percent_escaped(self.body))
  File "~/Library/Application Support/Anki2/addons21/1631622775/__init__.py", line 393, in custom
    default = ts_default_review_html(*args, **kwargs)
TypeError: revHtml() takes 1 positional argument but 2 were given

vsheg avatar Feb 02 '20 23:02 vsheg