Skip to content

Imports are not compatible with Anki 23.10.1 #28

@GBergatto

Description

@GBergatto

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions