mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1048799 - Improve mach build notification center errors. r=gps
This commit is contained in:
parent
f9a1f7967a
commit
1aa0b26726
@ -407,24 +407,27 @@ class Build(MachCommandBase):
|
||||
# is received.
|
||||
try:
|
||||
if sys.platform.startswith('darwin'):
|
||||
notifier = which.which('terminal-notifier')
|
||||
try:
|
||||
notifier = which.which('terminal-notifier')
|
||||
except which.WhichError:
|
||||
raise Exception('Install terminal-notifier to get '
|
||||
'a notification when the build finishes.')
|
||||
self.run_process([notifier, '-title',
|
||||
'Mozilla Build System', '-group', 'mozbuild',
|
||||
'-message', 'Build complete'], ensure_exit_code=False)
|
||||
elif sys.platform.startswith('linux'):
|
||||
try:
|
||||
import dbus
|
||||
bus = dbus.SessionBus()
|
||||
notify = bus.get_object('org.freedesktop.Notifications',
|
||||
'/org/freedesktop/Notifications')
|
||||
method = notify.get_dbus_method('Notify',
|
||||
'org.freedesktop.Notifications')
|
||||
method('Mozilla Build System', 0, '', 'Build complete', '', [], [], -1)
|
||||
except (ImportError, dbus.exceptions.DBusException):
|
||||
pass
|
||||
except ImportError:
|
||||
raise Exception('Install the python dbus module to '
|
||||
'get a notification when the build finishes.')
|
||||
bus = dbus.SessionBus()
|
||||
notify = bus.get_object('org.freedesktop.Notifications',
|
||||
'/org/freedesktop/Notifications')
|
||||
method = notify.get_dbus_method('Notify',
|
||||
'org.freedesktop.Notifications')
|
||||
method('Mozilla Build System', 0, '', 'Build complete', '', [], [], -1)
|
||||
|
||||
except (which.WhichError, ImportError):
|
||||
pass
|
||||
except Exception as e:
|
||||
self.log(logging.WARNING, 'notifier-failed', {'error':
|
||||
e.message}, 'Notification center failed: {error}')
|
||||
|
Loading…
Reference in New Issue
Block a user