carlos1172 / ProgressBarTimeLeft

Hello, this is my first "add-on" (which isn't really by me since I just tweaked/merged Glutanimate's Progress Bar add-on with Carlos Duarte's More Decks Stats and Time Left add-on.). I basically got the progress bar to work on 2.1.49, as well as added statistics for cards left, percentage left, time (s) spent per card based on today's reviews, and time left based on how fast you've done today's reviews. Note: it says studied 637 cards in 1.36 hours today (7.67 s/card) but that's not reflected in the progress bar because I did those reviews on iPad. Also, the progress bar only tracts reviews in your current anki session. If you restart the app, it'll reset to 0 cards done (but the total cards left will be less already). I have not tested this on any other version besides 2.1.49, but I just wanted to share it since it took me a while to get this working and I'm very proud of it (and am hugely thankful to Glutanimate and Mr. Duarte). Installation: Unzip them and paste them in C:\%APPDATA%\Anki2\addons21
14 stars 8 forks source link

AttributeError: 'NoneType' object has no attribute 'decks' #6

Closed GrimPixel closed 2 years ago

GrimPixel commented 2 years ago

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 to the add-on author. Debug info: Anki 2.1.50 (f84cc1d7) Python 3.10.4 Qt 6.3.0 PyQt 6.3.0 Platform: Linux Flags: frz=False ao=True sv=? Add-ons, last update check: 2022-04-23 11:48:25 Add-ons possibly involved: ⁨Progress Bar cards done cards left secondscard time spentleft and ETA⁩

Caught exception: Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/aqt/progress.py", line 115, in handler func() File "/usr/lib/python3.10/site-packages/aqt/main.py", line 186, in on_window_init fn() File "/usr/lib/python3.10/site-packages/aqt/main.py", line 277, in setupProfile self.showProfileManager() File "/usr/lib/python3.10/site-packages/aqt/main.py", line 283, in showProfileManager self.moveToState("profileManager") File "/usr/lib/python3.10/site-packages/aqt/main.py", line 672, in moveToState gui_hooks.state_did_change(state, oldState) File "/usr/lib/python3.10/site-packages/aqt/hooks_gen.py", line 3594, in call anki.hooks.runHook("afterStateChange", new_state, old_state) File "/usr/lib/python3.10/site-packages/anki/hooks.py", line 34, in runHook func(*args) File "/home/grim/.local/share/Anki2/addons21/1097423555/reviewer_progress_bar.py", line 402, in afterStateChangeCallBack currDID = mw.col.decks.current()['id'] AttributeError: 'NoneType' object has no attribute 'decks'

carlos1172 commented 2 years ago

Can you try disabling all other addons?

GrimPixel commented 2 years ago

The problem is, Anki has some trouble with my system, and it doesn't even open.

GrimPixel commented 2 years ago

I disabled all other add-ons. It still happened. Version ⁨2.1.52 (9fe3588e)⁩ Python 3.10.4 Qt 5.15.2 PyQt 5.15.6 Arch Linux

carlos1172 commented 2 years ago

I'm sorry, I don't know how to fix this :( On May 16, 2022, 10:45 PM +0800, GrimPixel @.***>, wrote:

I disabled all other add-ons. It still happened. Version ⁨2.1.52 (9fe3588e)⁩ Python 3.10.4 Qt 5.15.2 PyQt 5.15.6 Arch Linux — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

carlos1172 commented 2 years ago

@GrimPixel Workaround right now is to not have multiple profiles open

carlos1172 commented 2 years ago

fixed with BluMist's pull request