Skip to content

Commit

Permalink
Bug 1328153 - Change Linux notify to use the system command notify-se…
Browse files Browse the repository at this point in the history
…nd to avoid freedesktop dependency, r=gps

--HG--
extra : rebase_source : f9181c91827f5b67b5a9be3af81c08d51c4b0226
  • Loading branch information
wgianopoulos committed Jan 1, 2017
1 parent c6411b5 commit 258d322
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions python/mozbuild/mozbuild/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,16 +386,13 @@ def notify(self, msg):
'-message', msg], ensure_exit_code=False)
elif sys.platform.startswith('linux'):
try:
import dbus
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, '', msg, '', [], [], -1)
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
Expand Down

0 comments on commit 258d322

Please sign in to comment.