Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BetterTags 1.04 attributeError with Advanced Browser #109

Closed
PatientM opened this issue Dec 14, 2020 · 2 comments
Closed

BetterTags 1.04 attributeError with Advanced Browser #109

PatientM opened this issue Dec 14, 2020 · 2 comments

Comments

@PatientM
Copy link

I recently updated Anki and all the add-ons and seem to have an error between Advanced Browser and BetterTags 1.04. (see Error 1 below for output)

I realise that BetterTags 1.04 was written by another author (Glutanimate), however, that author has gone quiet since 29 April 2020.

It seems to my novice eye that the following issue has arisen from recent updates to Advanced Browser, and so I was wondering if you would be able to provide me with some guidance as to how I may resolve this bug myself. I know a little Python but I have never written an Anki addon.

The best I have figured out so far is that in BetterTags, the function sidebarTree is called but not defined properly (i.e. I can't find a class definition). I noticed, however, that sidbarTreeView is defined. So I updated all references to the former to the latter. After which, another error occurs, but in Advanced Browser (see Error 2 below for output).

This is where I am lost. I can't see to find where this second error is occurring.

Thanks in advance for any advice you could give me and apologises if I haven't provided enough information. If that is the case, then please let me know what I need to provide.

Cheers,
Patient M


Error 1

Anki 2.1.37 (6d596c8f) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Mac 10.15.7
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2020-12-14 10:18:43
Add-ons possibly involved: ⁨BetterTags, Advanced Browser⁩

Caught exception:
Traceback (most recent call last):
File "aqt/webview.py", line 35, in cmd
File "aqt/webview.py", line 124, in _onCmd
File "aqt/webview.py", line 569, in _onBridgeCmd
File "aqt/toolbar.py", line 170, in _linkHandler
File "aqt/toolbar.py", line 188, in _browseLinkHandler
File "aqt/main.py", line 1045, in onBrowse
File "aqt/init.py", line 100, in open
File "/Users/.../Library/Application Support/Anki2/addons21/874215009/advancedbrowser/core.py", line 206, in init
origInit(self, mw)
File "", line 2, in init
File "anki/hooks.py", line 89, in decorator_wrapper
File "anki/hooks.py", line 80, in repl
File "", line 2, in init
File "anki/hooks.py", line 89, in decorator_wrapper
File "anki/hooks.py", line 80, in repl
File "aqt/browser.py", line 600, in init
File "", line 2, in setupSidebar
File "anki/hooks.py", line 89, in decorator_wrapper
File "anki/hooks.py", line 81, in repl
File "/Users/.../Library/Application Support/Anki2/addons21/bettertags/sidebar/init.py", line 43, in onSetupSidebar
browser.sidebarTree._deferredInit()
AttributeError: 'NewSidebarTreeView' object has no attribute '_deferredInit'


Error 2

Anki 2.1.37 (6d596c8f) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Mac 10.15.7
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2020-12-14 10:18:43
Add-ons possibly involved: ⁨Advanced Browser⁩

Caught exception:
Traceback (most recent call last):
File "aqt/webview.py", line 35, in cmd
File "aqt/webview.py", line 124, in _onCmd
File "aqt/webview.py", line 569, in _onBridgeCmd
File "aqt/toolbar.py", line 170, in _linkHandler
File "aqt/toolbar.py", line 188, in _browseLinkHandler
File "aqt/main.py", line 1045, in onBrowse
File "aqt/init.py", line 100, in open
File "/Users/.../Library/Application Support/Anki2/addons21/874215009/advancedbrowser/core.py", line 206, in init
origInit(self, mw)
TypeError: newBrowserInit() takes 2 positional arguments but 3 were given

@hssm
Copy link
Contributor

hssm commented Dec 16, 2020

Error 1: Advanced Browser is unrelated to the issue. It appears in the stack trace because it replaces the default browser. You'll see the same issue even if you disabled Advanced Browser.

Error 2: Not sure. Seems to be similar to this issue but we never got followup so I don't understand what's happening. I have my doubts about Advanced Browser being the cause since it works fine everywhere else (I don't know what this bettertags add-on is so can't test it) but it's not impossible there is a conflict in the order of overriding or extending init functions of the browser in both add-ons. Also worth trying to disabled Advanced Browser and seeing if you still have a similar error.

@ijgnd
Copy link
Collaborator

ijgnd commented Jan 30, 2022

Most of the functionality of the add-on BetterTags was built into anki in and after 2.1.41+ (released in 2021-03-07) so this problem is no longer relevant.

@ijgnd ijgnd closed this as completed Jan 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants