Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpgritti@gmail.com>2008-10-22 08:17:57 (GMT)
committer Marco Pesenti Gritti <mpgritti@gmail.com>2008-10-22 08:17:57 (GMT)
commit17d797ea4e9b35f57b42c99eb197ad301dadbb01 (patch)
treeea6663ada4690ea78633dab9b3ee210f9a8b0da4 /src
parent7cf2e47a0f9cdfb18c82f01ae06265509e4ec00d (diff)
Do not die if NetworkManager is not running.
Diffstat (limited to 'src')
-rw-r--r--src/jarabe/desktop/meshbox.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/jarabe/desktop/meshbox.py b/src/jarabe/desktop/meshbox.py
index b0f8a39..83d0ba6 100644
--- a/src/jarabe/desktop/meshbox.py
+++ b/src/jarabe/desktop/meshbox.py
@@ -465,8 +465,14 @@ class NetworkManagerObserver(object):
self._bus = dbus.SystemBus()
self._devices = {}
- obj = self._bus.get_object(_NM_SERVICE, _NM_PATH)
- netmgr = dbus.Interface(obj, _NM_IFACE)
+ def listen(self):
+ try:
+ obj = self._bus.get_object(_NM_SERVICE, _NM_PATH)
+ netmgr = dbus.Interface(obj, _NM_IFACE)
+ except dbus.DBusException:
+ logging.debug('%s service not available', _NM_SERVICE)
+ return
+
netmgr.GetDevices(reply_handler=self._get_devices_reply_cb,
error_handler=self._get_devices_error_cb)
@@ -552,6 +558,7 @@ class MeshBox(gtk.VBox):
self._model.connect('activity-removed', self._activity_removed_cb)
netmgr_observer = NetworkManagerObserver(self)
+ netmgr_observer.listen()
def do_size_allocate(self, allocation):
width = allocation.width