krassowski / Anki-TouchScreen

Touchscreen functionality for Anki
https://ankiweb.net/shared/info/1631622775
GNU General Public License v3.0
25 stars 13 forks source link

Imports are not compatible with Anki 23.10.1 #28

Open GBergatto opened 10 months ago

GBergatto commented 10 months ago

When trying to run this add-on on Anki 23.10.1, I get the following error message:

Anki 23.10.1 (fac9e0e) Python 3.11.6 Qt 6.6.1 PyQt 6.6.1
Platform: Linux-6.6.7-arch1-1-x86_64-with-glibc2.38
Flags: frz=False ao=True sv=3
Add-ons, last update check: 2023-12-23 08:19:36

When loading Write on your screen:
Traceback (most recent call last):
  File "/home/gb/.local/share/Anki2/addons21/567651868/__init__.py", line 481, in ts_setup_menu
    mw.addon_view_menu
AttributeError: 'AnkiQt' object has no attribute 'addon_view_menu'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/aqt/addons.py", line 245, in loadAddons
    __import__(addon.dir_name)
  File "/home/gb/.local/share/Anki2/addons21/567651868/__init__.py", line 519, in <module>
    ts_onload()
  File "/home/gb/.local/share/Anki2/addons21/567651868/__init__.py", line 183, in ts_onload
    ts_setup_menu()
  File "/home/gb/.local/share/Anki2/addons21/567651868/__init__.py", line 483, in ts_setup_menu
    mw.addon_view_menu = QMenu(_(u"&View"), mw)
                         ^^^^^^^^^^^^^^^^^^^^^^
TypeError: arguments did not match any overloaded call:
  QMenu(parent: Optional[QWidget] = None): argument 1 has unexpected type 'str'
  QMenu(title: Optional[str], parent: Optional[QWidget] = None): argument 2 has unexpected type 'AnkiQt'