From f8d4c7d88f8d1e3cddd016bbb7ce6df83114d5fb Mon Sep 17 00:00:00 2001 From: Raphael Roberts Date: Fri, 29 Nov 2019 13:33:53 -0600 Subject: [PATCH] Made the notification more useful by putting route in title --- ctabus/__main__.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ctabus/__main__.py b/ctabus/__main__.py index 12416d4..e3c4c78 100644 --- a/ctabus/__main__.py +++ b/ctabus/__main__.py @@ -85,11 +85,16 @@ def pprint_delta(delta): return ret -config = """\ +text_config = """\ {route} - {end} ({direction}) {nm}, stop {stop_id} {delta} ({t})\ """ +notification_config = """\ +{direction} +{nm}, stop {stop_id} +{delta} ({t})\ +""" def show( @@ -116,11 +121,11 @@ def show( "end": bustime["des"], "nm": bustime["stpnm"].rstrip(), } - text_to_show = config.format(**format_dict) + text_to_show = text_config.format(**format_dict) if do_gui and enable_notifications: notification_module.nm.setup_exiter(EXIT) - notification_module.nm.set_title("Bustimes") - notification_module.nm.say(text_to_show) + notification_module.nm.set_title("{route} - {end}".format(**format_dict)) + notification_module.nm.say(notification_config.format(**format_dict)) if do_gui and enable_toast: toast(text_to_show)