Bug 1445193 - Use notify-send on Tier3 platforms as well. r=gps

MozReview-Commit-ID: 4ONdrhqc6zf

--HG--
extra : rebase_source : 6773d64fb7dc3cfa56c148a9b455ac03e81b465d
This commit is contained in:
Jan Beich 2018-03-13 10:29:11 +00:00
Родитель 18fc026b3a
Коммит b2c12ddb46
1 изменённых файлов: 9 добавлений и 9 удалений

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

@ -502,15 +502,6 @@ class MozbuildObject(ProcessExecutionMixin):
self.run_process([notifier, '-title',
'Mozilla Build System', '-group', 'mozbuild',
'-message', msg], ensure_exit_code=False)
elif sys.platform.startswith('linux'):
try:
notifier = which.which('notify-send')
except which.WhichError:
raise Exception('Install notify-send (usually part of '
'the libnotify package) to get a notification when '
'the build finishes.')
self.run_process([notifier, '--app-name=Mozilla Build System',
'Mozilla Build System', msg], ensure_exit_code=False)
elif sys.platform.startswith('win'):
from ctypes import Structure, windll, POINTER, sizeof
from ctypes.wintypes import DWORD, HANDLE, WINFUNCTYPE, BOOL, UINT
@ -536,6 +527,15 @@ class MozbuildObject(ProcessExecutionMixin):
console,
FLASHW_CAPTION | FLASHW_TRAY | FLASHW_TIMERNOFG, 3, 0)
FlashWindowEx(params)
else:
try:
notifier = which.which('notify-send')
except which.WhichError:
raise Exception('Install notify-send (usually part of '
'the libnotify package) to get a notification when '
'the build finishes.')
self.run_process([notifier, '--app-name=Mozilla Build System',
'Mozilla Build System', msg], ensure_exit_code=False)
except Exception as e:
self.log(logging.WARNING, 'notifier-failed', {'error':
e.message}, 'Notification center failed: {error}')