From 6fa266e3e090cdfba6dc26cf35ee392614d350cd Mon Sep 17 00:00:00 2001 From: algorandpa Date: Sun, 4 Dec 2022 21:13:33 +0000 Subject: [PATCH 1/3] wrap notification process in try catch and capture stderr data --- piker/ui/_notify.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/piker/ui/_notify.py b/piker/ui/_notify.py index c4804663..ee79c75d 100644 --- a/piker/ui/_notify.py +++ b/piker/ui/_notify.py @@ -82,7 +82,6 @@ async def notify_from_ems_status_msg( os.environ['DBUS_SESSION_BUS_ADDRESS'] = ( f'unix:path=/run/user/{_dbus_uid}/bus' ) - result = await trio.run_process( [ 'notify-send', @@ -93,6 +92,17 @@ async def notify_from_ems_status_msg( # TODO: add in standard fill/exec info that maybe we # pack in a broker independent way? f"'{msg.pformat()}'", - ], + ], + capture_stdout=True, + capture_stderr=True, + check=False, ) - log.runtime(result) + if result.returncode != 0: + log.warn(f'No notification daemon installed stderr: {result.stderr}') + + + log.runtime(result) + + + + From f3427bb13b8713517406e69fb7fcd073f0de94e8 Mon Sep 17 00:00:00 2001 From: algorandpa Date: Sun, 4 Dec 2022 21:15:41 +0000 Subject: [PATCH 2/3] restore spacing --- piker/ui/_notify.py | 1 + 1 file changed, 1 insertion(+) diff --git a/piker/ui/_notify.py b/piker/ui/_notify.py index ee79c75d..c7568eac 100644 --- a/piker/ui/_notify.py +++ b/piker/ui/_notify.py @@ -82,6 +82,7 @@ async def notify_from_ems_status_msg( os.environ['DBUS_SESSION_BUS_ADDRESS'] = ( f'unix:path=/run/user/{_dbus_uid}/bus' ) + result = await trio.run_process( [ 'notify-send', From 997bf31bd40d11ea0f38a213d2e4e7b80efaeb52 Mon Sep 17 00:00:00 2001 From: algorandpa Date: Sun, 4 Dec 2022 21:19:34 +0000 Subject: [PATCH 3/3] remove spacing again --- piker/ui/_notify.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/piker/ui/_notify.py b/piker/ui/_notify.py index c7568eac..bfff686e 100644 --- a/piker/ui/_notify.py +++ b/piker/ui/_notify.py @@ -82,7 +82,7 @@ async def notify_from_ems_status_msg( os.environ['DBUS_SESSION_BUS_ADDRESS'] = ( f'unix:path=/run/user/{_dbus_uid}/bus' ) - + result = await trio.run_process( [ 'notify-send', @@ -100,10 +100,5 @@ async def notify_from_ems_status_msg( ) if result.returncode != 0: log.warn(f'No notification daemon installed stderr: {result.stderr}') - - - log.runtime(result) - - - - + + log.runtime(result)