From 6e46fb329ded444294d81db55d6b88ee3d8da1b2 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Thu, 10 Oct 2024 15:42:39 +0000 Subject: [PATCH] qml/qeapp.py: (trivial) use os.path.join for constructing path There is an issue with plyer on Windows, which I thought was related to the mixed backwards/forward slashes in the path, but no, this change still did not fix it: ``` 1.84 | D | gui.qml.qeapp.QEAppController | sending push notification to OS: message='heyheyhey' Traceback (most recent call last): File "...\electrum\electrum\util.py", line 1111, in run_with_except_hook run_original(*args2, **kwargs2) File "...\Python310\lib\threading.py", line 953, in run self._target(*self._args, **self._kwargs) File "...\plyer\platforms\win\libs\balloontip.py", line 206, in balloon_tip WindowsBalloonTip(**kwargs) File "...\plyer\platforms\win\libs\balloontip.py", line 130, in __init__ raise Exception('Could not load icon {}'.format(app_icon)) Exception: Could not load icon ...\electrum\electrum\gui\icons\electrum.png ``` --- electrum/gui/qml/qeapp.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/electrum/gui/qml/qeapp.py b/electrum/gui/qml/qeapp.py index 05e1599c7..bdbec8700 100644 --- a/electrum/gui/qml/qeapp.py +++ b/electrum/gui/qml/qeapp.py @@ -154,8 +154,9 @@ class QEAppController(BaseCrashReporter, QObject): global notification if not notification: from plyer import notification - icon = (os.path.dirname(os.path.realpath(__file__)) - + '/../icons/electrum.png') + icon = os.path.join( + os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "icons", "electrum.png", + ) notification.notify('Electrum', message, app_icon=icon, app_name='Electrum') except ImportError: self.logger.warning('Notification: needs plyer; `sudo python3 -m pip install plyer`')