diff --git a/.github/workflows/ci/skiplist_os_linux.txt b/.github/workflows/ci/skiplist_os_linux.txt index 83aa7abb0..6eaafbafb 100644 --- a/.github/workflows/ci/skiplist_os_linux.txt +++ b/.github/workflows/ci/skiplist_os_linux.txt @@ -2,7 +2,6 @@ .github/workflows/ci/skiplist_os_macOS.txt osx/* plover/oslayer/log_osx.py -plover/oslayer/log_plyer.py plover/oslayer/osxkeyboardcontrol.py plover/oslayer/osxkeyboardlayout.py plover/oslayer/winkeyboardcontrol.py diff --git a/.github/workflows/ci/skiplist_os_macos.txt b/.github/workflows/ci/skiplist_os_macos.txt index 0c7370db7..e571846b3 100644 --- a/.github/workflows/ci/skiplist_os_macos.txt +++ b/.github/workflows/ci/skiplist_os_macos.txt @@ -2,7 +2,6 @@ .github/workflows/ci/skiplist_os_Windows.txt linux/* plover/oslayer/log_dbus.py -plover/oslayer/log_plyer.py plover/oslayer/winkeyboardcontrol.py plover/oslayer/winkeyboardlayout.py plover/oslayer/xkeyboardcontrol.py diff --git a/news.d/bugfix/1508.windows.md b/news.d/bugfix/1508.windows.md new file mode 100644 index 000000000..0233567ef --- /dev/null +++ b/news.d/bugfix/1508.windows.md @@ -0,0 +1 @@ +Fix notifications behavior: no persistent duplicated icons (one for each notification). diff --git a/plover/log.py b/plover/log.py index 6d32555e1..23a38dc3b 100644 --- a/plover/log.py +++ b/plover/log.py @@ -90,9 +90,6 @@ def setup_platform_handler(self): elif PLATFORM == 'mac': from plover.oslayer.log_osx import OSXNotificationHandler handler_class = OSXNotificationHandler - elif PLATFORM == 'win': - from plover.oslayer.log_plyer import PlyerNotificationHandler - handler_class = PlyerNotificationHandler except Exception: self.info('could not import platform gui log', exc_info=True) if handler_class is None: diff --git a/plover/oslayer/log_plyer.py b/plover/oslayer/log_plyer.py deleted file mode 100644 index c26aa874c..000000000 --- a/plover/oslayer/log_plyer.py +++ /dev/null @@ -1,43 +0,0 @@ -import os -import logging - -from plyer import notification - -from plover import log, __name__ as __software_name__ -from plover.oslayer.config import ASSETS_DIR, PLATFORM - - -APPNAME = __software_name__.capitalize() - -if PLATFORM == 'win': - APPICON = os.path.join(ASSETS_DIR, 'plover.ico') -else: - APPICON = os.path.join(ASSETS_DIR, 'plover_32x32.png') - - -class PlyerNotificationHandler(logging.Handler): - """ Handler using Plyer's notifications to show messages. """ - - def __init__(self): - super().__init__() - self.setLevel(log.WARNING) - self.setFormatter(log.NoExceptionTracebackFormatter('%(levelname)s: %(message)s')) - - def emit(self, record): - level = record.levelno - message = self.format(record) - if message.endswith('\n'): - message = message[:-1] - if level <= log.INFO: - timeout = 10 - elif level <= log.WARNING: - timeout = 15 - else: - timeout = 60 - notification.notify( - app_name=APPNAME, - app_icon=APPICON, - title=APPNAME, - message=message, - timeout=timeout, - ) diff --git a/reqs/constraints.txt b/reqs/constraints.txt index 81fc30811..a4020b081 100644 --- a/reqs/constraints.txt +++ b/reqs/constraints.txt @@ -38,7 +38,6 @@ plover-plugins-manager==0.7.0 plover-stroke==1.0.1 plover-treal==1.0.1 pluggy==1.0.0 -plyer==2.0.0 py==1.10.0 pycparser==2.20 Pygments==2.10.0 diff --git a/reqs/dist_extra_log.txt b/reqs/dist_extra_log.txt index d88145ee5..a33dea78d 100644 --- a/reqs/dist_extra_log.txt +++ b/reqs/dist_extra_log.txt @@ -1,4 +1,3 @@ dbus-python>=1.2.4; "linux" in sys_platform -plyer>=1.3.1; "win32" in sys_platform # vim: ft=cfg commentstring=#\ %s list