From c16024871776604e668a3275330ae63ab6745ba4 Mon Sep 17 00:00:00 2001 From: andars Date: Tue, 12 May 2015 18:38:47 -0700 Subject: Add mac support for build notifications Closes #5582 --- python/servo/build_commands.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'python/servo/build_commands.py') diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py index 5b4e46f9e8a..5d5da3298fe 100644 --- a/python/servo/build_commands.py +++ b/python/servo/build_commands.py @@ -55,8 +55,15 @@ def notify(elapsed): print("[Warning] Could not generate notification! Please make sure that the required libraries are installed!") elif sys.platform.startswith('darwin'): - # Notification code for Darwin here! For the time being printing simple msg - print("[Warning] : Darwin System! Notifications not supported currently!") + try: + from distutils.spawn import find_executable + notifier = find_executable('terminal-notifier') + if not notifier: + raise Exception('`terminal-notifier` not found') + subprocess.call([notifier, '-title', 'Servo Build System', + '-group', 'servobuild', '-message', 'Servo build complete!']) + except: + print("[Warning] Could not generate notification! Make sure that `terminal-notifier is installed!") @CommandProvider -- cgit v1.2.3