servo: Merge #6506 - notify_darwin should trap import errors (from mt2d2:darwin_notification_imports); r=metajack

notify_darwin should trap import errors and should provide the useful package name for the user to install. Fix for issue #6479.

Source-Repo: https://github.com/servo/servo
Source-Revision: 3df35c2f42d7224560837a9ef63400e0e16829bf
This commit is contained in:
Michael Tremel 2015-06-28 11:05:36 -06:00
Родитель 7190d1c94a
Коммит 9d41cdae1b
1 изменённых файлов: 14 добавлений и 11 удалений

Просмотреть файл

@ -64,6 +64,7 @@ def notify_win(title, text):
def notify_darwin(title, text):
try:
import Foundation
import objc
@ -79,6 +80,8 @@ def notify_darwin(title, text):
centre = NSUserNotificationCenter.defaultUserNotificationCenter()
centre.scheduleNotification_(note)
except ImportError:
raise Exception("Please make sure that the Python pyobjc module is installed!")
def notify_build_done(elapsed):