darkdetect
darkdetect copied to clipboard
Implement Listener Class
Implements: https://github.com/albertosottile/darkdetect/issues/31
Changes:
_mac_detect.pyand other files now only need to expose only two objects,themeand someBaseListenersubclass.__all__added to_*_detect.pyfiles so that only the main objects are dumped when doingimport *py.typedadded to allow better type annotation checking via tools such asmypy- General code quality improvements, mostly stuff
pylintcomplained about - Move
isDark(),isLight(), anddef listenerout into__init__.pyto avoid code duplication.
Before merging:
Required
- [x] Test on macOS with extras installed
- [x] Test on macOS without extras installed
- [x] Test on Linux that uses Gnome (like Ubuntu 22.04)
- [x] Test on Windows
- [x] Documentation about new API
Optional
- [ ] If possible have
WindowsListener.stop(0)be more than a no-op
After merging:
New Issues:
- [ ] Feature Request: Support
.stop(None)for Windows by improving Windows stop function