darkdetect icon indicating copy to clipboard operation
darkdetect copied to clipboard

Implement Listener Class

Open zwimer opened this issue 2 years ago • 12 comments

Implements: https://github.com/albertosottile/darkdetect/issues/31

Changes:

  1. _mac_detect.py and other files now only need to expose only two objects, theme and some BaseListener subclass.
  2. __all__ added to _*_detect.py files so that only the main objects are dumped when doing import *
  3. py.typed added to allow better type annotation checking via tools such as mypy
  4. General code quality improvements, mostly stuff pylint complained about
  5. Move isDark(), isLight(), and def listener out into __init__.py to 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

zwimer avatar Dec 08 '22 22:12 zwimer