[Telepathy-commits] [telepathy-butterfly/master] Catch NameExistsException and exit if the CM cannot get its unique name.

Jonny Lamb jonny.lamb at collabora.co.uk
Mon Dec 22 17:10:56 PST 2008


Signed-off-by: Jonny Lamb <jonny.lamb at collabora.co.uk>
---
 telepathy-butterfly |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/telepathy-butterfly b/telepathy-butterfly
index a2e5c82..55f634e 100755
--- a/telepathy-butterfly
+++ b/telepathy-butterfly
@@ -22,6 +22,7 @@ import gobject
 import dbus.glib
 import signal
 import os
+import sys
 
 import logging
 
@@ -61,7 +62,12 @@ if __name__ == '__main__':
 
     signal.signal(signal.SIGTERM, lambda : quit)
 
-    manager = ButterflyConnectionManager(shutdown_callback)
+    try:
+        manager = ButterflyConnectionManager(shutdown_func=shutdown_callback)
+    except dbus.exceptions.NameExistsException:
+        logger.warning('Failed to acquire bus name, connection manager already running?')
+        sys.exit(1)
+
     mainloop = gobject.MainLoop(is_running=True)
 
     while mainloop.is_running():
-- 
1.5.6.5



More information about the Telepathy-commits mailing list