Browse Source

Made the notification more useful by putting route in title

atexit
Raphael Roberts 6 years ago
parent
commit
f8d4c7d88f
  1. 13
      ctabus/__main__.py

13
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)

Loading…
Cancel
Save