Better error handling when no libpurple dbus service is detected. This was Etan's suggestion. Fixes #3278.

Tue, 02 Oct 2007 02:17:53 +0000

author
Daniel Atallah <datallah@pidgin.im>
date
Tue, 02 Oct 2007 02:17:53 +0000
changeset 20799
2329d6952dbc
parent 20798
d3e55371644f
child 20800
76183d18c059

Better error handling when no libpurple dbus service is detected. This was Etan's suggestion. Fixes #3278.

libpurple/purple-remote file | annotate | diff | comparison | revisions
--- a/libpurple/purple-remote	Mon Oct 01 17:54:21 2007 +0000
+++ b/libpurple/purple-remote	Tue Oct 02 02:17:53 2007 +0000
@@ -9,7 +9,12 @@
 
 xml.dom.minidom.Element.all   = xml.dom.minidom.Element.getElementsByTagName
 
-obj = dbus.SessionBus().get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject")
+obj = None
+try:
+    obj = dbus.SessionBus().get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject")
+except:
+    pass
+
 purple = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface")
 
 class CheckedObject:
@@ -212,7 +217,10 @@
 
 if len(sys.argv) == 1:
     show_help()
-
+elif (obj == None):
+    print "No existing libpurple instance detected."
+    sys.exit(1);
+    
 for arg in sys.argv[1:]:
     output = execute(arg)
 

mercurial