cafelinked / multi-decker

An add-on to create multiple empty decks in Anki
MIT License
1 stars 1 forks source link

PyQt6 Compatibility: Replace exec_() with exec() in MultiDeckerDialog #1

Open voothi opened 1 week ago

voothi commented 1 week ago

Anki 24.06.3 (d678e393) (ao) Python 3.9.18 Qt 6.6.2 PyQt 6.6.1 Platform: Windows-10-10.0.22621

Traceback (most recent call last): File "C:\Users\user\AppData\Roaming\Anki2\addons21\1110722673__init__.py", line 36, in create_multidecker dialog.exec() AttributeError: 'MultiDeckerDialog' object has no attribute 'exec_'

===Add-ons (active)=== (add-on provided name [Add-on folder, installed at, version, is config changed]) Add Table ['1237621971', 2023-06-18T13:37, 'None', mod] Add note ID Fixed by Shige ['8897764', 2024-01-13T20:28, 'None', ''] Advanced Browser ['874215009', 2023-10-21T16:34, 'None', ''] Advanced Copy Fields ['1898445115', 2024-01-08T18:01, 'v0.4.01', ''] Anki IPA - Add phonetic symbols Fixed by Shige ['391848360', 2024-09-03T19:30, 'None', mod] AnkiConnect ['2055492159', 2024-07-26T06:55, 'None', mod] Batch Editing ['291119185', 2023-10-26T02:38, 'None', ''] BetterSearch ['1052724801', 2024-03-06T17:25, 'None', ''] Clear all fields ['261351307', 2023-12-23T12:05, 'None', ''] Customize Keyboard Shortcuts ['24411424', 2023-11-01T10:17, 'None', mod] Editor Scripts Symbols ['2065559429', 2022-07-25T19:48, 'None', mod] External Note Editor vim vscode atom ['704320065', 2022-05-17T14:42, 'None', mod] Fast cards reposition ['544982740', 2021-09-19T15:51, 'None', mod] Google Translate ['1536291224', 2024-05-08T16:16, 'None', mod] Highlight Search Results in the Browser ['225180905', 2023-10-21T21:17, 'None', ''] Hint Hotkeys ['1844908621', 2023-04-14T16:13, 'None', mod] Markdown and KaTeX Support ['1087328706', 2023-05-06T13:28, 'None', ''] Markdown input ['904999275', 2023-09-01T23:46, '2.2.3', mod] Merge Duplicate Notes ['55394168', 2024-01-19T16:16, 'None', ''] Multi Deck Importer Fixed by Shige ['1563006742', 2024-02-17T01:33, 'None', ''] Multi search using a list of words ['831327139', 2024-09-06T16:16, 'None', mod] Multi-Decker ['1110722673', 2023-06-11T08:20, 'None', ''] OpenInExternalEditorRenameDuplicate for ImageAudioVideo WinLinux ['1560623518', 2023-03-19T18:33, 'None', ''] Record Own Voice History ['1508039970', 2024-02-18T14:32, 'None', ''] Remove Cloze Button and Hotkey ['1966460736', 2022-05-21T12:29, 'None', mod] Reset Ease ['947935257', 2023-11-12T02:22, 'None', ''] Review Heatmap ['1771074083', 2022-06-30T03:43, 'None', ''] Sentence adder for any language with batch add option ['1682655437', 2024-06-25T17:53, 'None', ''] Sort clozes ['157021113', 2023-04-18T00:50, '1.0.0', ''] Speed Focus Mode auto-alert auto-reveal auto-answer ['1046608507', 2022-12-16T12:24, 'None', ''] Spell Checker ['369581638', 2023-10-11T15:47, 'None', ''] ZIM Reader ['951350249', 2023-02-21T22:12, 'None', mod] export cardsnotes from browser with metadata to csv or xlsx ['1967530655', 2024-03-28T14:16, 'None', mod] extended editor for field for tables searchreplace ['805891399', 2023-07-31T16:12, 'None', mod] gTTS text to speech support ['391644525', 2023-10-19T05:02, 'None', '']

===IDs of active AnkiWeb add-ons=== 1046608507 1052724801 1087328706 1110722673 1237621971 1508039970 1536291224 1560623518 1563006742 157021113 1682655437 1771074083 1844908621 1898445115 1966460736 1967530655 2055492159 2065559429 225180905 24411424 261351307 291119185 369581638 391644525 391848360 544982740 55394168 704320065 805891399 831327139 874215009 8897764 904999275 947935257 951350249

===Add-ons (inactive)=== (add-on provided name [Add-on folder, installed at, version, is config changed]) Add note id ['1672832404', 2020-12-06T11:44, 'None', ''] Addons Code Exporter ['1994540215', 2021-01-03T19:50, 'None', ''] Anki X Markdown X MindMap ['728482867', 2022-07-09T06:07, 'None', ''] AwesomeTTS - Add speech to your flashcards ['1436550454', 2024-09-06T02:00, 'None', ''] Basic Printing Support ['1025789669', 2023-10-19T04:57, 'None', ''] Choose in which order you see new cards ['1665261045', 2020-12-23T05:49, 'None', ''] Create cloze cards from reverso sentences ['680321806', 2022-03-21T01:25, 'None', mod] External Note Editor for the Browser ['1996266159', 2020-03-31T22:59, 'None', ''] FieldReporter ['569864517', 2023-04-09T17:00, 'None', ''] Highlight Color Shortcut ['1178291236', 2021-04-01T18:42, 'None', mod] HyperTTS - Add speech to your flashcards ['111623432', 2024-08-12T08:48, 'None', mod] Language Tools - Learn Foreign Languages with Anki ['771677663', 2024-04-16T00:18, 'None', mod] Multiple decks creator ['461193445', 2024-07-24T06:32, 'None', ''] PassFail 2 Remove the Easy and Hard buttons ['876946123', 2024-06-04T03:56, 'None', ''] Review Card Order Customizer - V2 Scheduler only ['81245454', 2023-08-20T06:38, 'None', ''] Review in Created Order Fix ['252796796', 2023-12-13T05:54, 'None', ''] SearchFilter Bar Command Palette for Context Menus ['1842492261', 2023-03-19T18:31, 'None', ''] Searching PDF Reading Note-Taking in Add Dialog ['1781298089', 2022-08-15T09:22, 'None', mod] Smart Copy ['2026164196', 2021-12-03T13:38, 'None', mod] Word Shuffler - Sentences randomizer ['1190756458', 2021-03-30T23:45, 'None', '']

The error you're encountering is due to the use of the exec_() method in PyQt6, which has been deprecated in favor of exec() in recent versions of PyQt6. The MultiDeckerDialog class is trying to call exec_(), but since you're using PyQt 6.6.1, that method is no longer available.

To resolve this, you need to modify the add-on's code where exec_() is called. Follow these steps:

  1. Navigate to the folder containing the add-on causing the issue (Multi-Decker, which is add-on ID 1110722673).
  2. Open the file __init__.py in a text editor.
  3. Look for the line where dialog.exec_() is called.
  4. Replace exec_() with exec().
  5. Save the file and restart Anki.

This should fix the problem by using the correct method for the version of PyQt you're running.

Let me know if you need further assistance!

cafelinked commented 1 week ago

Thank you for your error log. I will take a look at it in few hours and update you with an ETA for fix.