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

When loading 'Life Drain' Error #37

Closed
Kosezu opened this issue Jul 13, 2019 · 7 comments · Fixed by #38
Closed

When loading 'Life Drain' Error #37

Kosezu opened this issue Jul 13, 2019 · 7 comments · Fixed by #38
Assignees
Labels
bug Something isn't working as expected

Comments

@Kosezu
Copy link

Kosezu commented Jul 13, 2019

When loading 'Life Drain':
Traceback (most recent call last):
File "aqt/addons.py", line 80, in loadAddons
File "/Users/csosborn/Library/Application Support/Anki2/addons21/715575551/init.py", line 4, in
from . import lifedrain # pylint: disable=unused-import
File "/Users/csosborn/Library/Application Support/Anki2/addons21/715575551/lifedrain.py", line 789, in
import Night_Mode
File "/Users/csosborn/Library/Application Support/Anki2/addons21/Night_Mode.py", line 99, in
nm_default_css_top = mw.toolbar._css
AttributeError: 'Toolbar' object has no attribute '_css'

@Yutsuten
Copy link
Owner

The error is when importing Night Mode...
Did you upgraded Night Mode recently? Seems like a change there broke Life Drain.

@Yutsuten
Copy link
Owner

Yutsuten commented Jul 13, 2019

To be honest, this feels more a Night Mode bug than a Life Drain bug, even though I can fix the exception being raised in Life Drain.

@Yutsuten
Copy link
Owner

try:
import Night_Mode
Night_Mode.nm_css_menu += 'QMainWindow::separator { width: 0px; height: 0px; }'
except ImportError:
pass

At line 791, can you change except ImportError: to except Exception: to see if it solves the problem in Life Drain?

@Yutsuten Yutsuten self-assigned this Jul 13, 2019
@Yutsuten Yutsuten added the bug Something isn't working as expected label Jul 13, 2019
@Kosezu
Copy link
Author

Kosezu commented Jul 13, 2019

I'm on the most recent version of Night Mode that's up on Add-ons for Anki 2.1

@Kosezu
Copy link
Author

Kosezu commented Jul 13, 2019

I made the edit; no longer get the error. Did that disable night mode for Life Drain?

@Yutsuten
Copy link
Owner

No, it only ignores the error.

@Kosezu
Copy link
Author

Kosezu commented Jul 13, 2019

Thank you for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants