aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/build_commands.py
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@gmail.com>2015-09-26 16:04:46 -0400
committerTamir Duberstein <tamird@gmail.com>2015-09-26 16:14:45 -0400
commitb6bbd754791d519316576c62daf1e9ff62e2756d (patch)
tree28c25f9adef7e47e0c64b78a413ad721fb318346 /python/servo/build_commands.py
parentd39c8546b6bf03c69b1cde925c72722dfd61e588 (diff)
downloadservo-b6bbd754791d519316576c62daf1e9ff62e2756d.tar.gz
servo-b6bbd754791d519316576c62daf1e9ff62e2756d.zip
mach: fix OS X notifications
Diffstat (limited to 'python/servo/build_commands.py')
-rw-r--r--python/servo/build_commands.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py
index 73d9b9046fa..d7ae9cd5f0e 100644
--- a/python/servo/build_commands.py
+++ b/python/servo/build_commands.py
@@ -66,19 +66,20 @@ def notify_win(title, text):
def notify_darwin(title, text):
try:
import Foundation
- import objc
- NSUserNotification = objc.lookUpClass("NSUserNotification")
- NSUserNotificationCenter = objc.lookUpClass("NSUserNotificationCenter")
+ bundleDict = Foundation.NSBundle.mainBundle().infoDictionary()
+ bundleIdentifier = 'CFBundleIdentifier'
+ if bundleIdentifier not in bundleDict:
+ bundleDict[bundleIdentifier] = 'mach'
- note = NSUserNotification.alloc().init()
+ note = Foundation.NSUserNotification.alloc().init()
note.setTitle_(title)
note.setInformativeText_(text)
now = Foundation.NSDate.dateWithTimeInterval_sinceDate_(0, Foundation.NSDate.date())
note.setDeliveryDate_(now)
- centre = NSUserNotificationCenter.defaultUserNotificationCenter()
+ centre = Foundation.NSUserNotificationCenter.defaultUserNotificationCenter()
centre.scheduleNotification_(note)
except ImportError:
raise Exception("Please make sure that the Python pyobjc module is installed!")