[Pkg-bazaar-commits] ./bzr-gtk/unstable r496: merge seahorse detection (fixes #228922)

Sabin Iacob (m0n5t3r) iacobs at m0n5t3r.info
Fri Apr 10 07:50:33 UTC 2009


------------------------------------------------------------
revno: 496
committer: Sabin Iacob (m0n5t3r) <iacobs at m0n5t3r.info>
branch nick: bzr-gtk
timestamp: Mon 2008-05-26 14:50:59 +0300
message:
  merge seahorse detection (fixes #228922)
modified:
  seahorse.py
    ------------------------------------------------------------
    revno: 487.4.1
    committer: Sabin Iacob (m0n5t3r) <iacobs at m0n5t3r.info>
    branch nick: bzr-gtk.bug228922
    timestamp: Sun 2008-05-11 14:57:23 +0300
    message:
      fix seahorse existence check
    modified:
      seahorse.py
    ------------------------------------------------------------
    revno: 487.4.2
    committer: Sabin Iacob (m0n5t3r) <iacobs at m0n5t3r.info>
    branch nick: bzr-gtk.bug228922
    timestamp: Fri 2008-05-23 11:23:59 +0300
    message:
      don't ignore all DBus exceptions
    modified:
      seahorse.py
-------------- next part --------------
=== modified file 'seahorse.py'
--- a/seahorse.py	2008-05-01 21:49:50 +0000
+++ b/seahorse.py	2008-05-23 08:23:59 +0000
@@ -28,21 +28,17 @@
 KEY_TYPE_OPENPGP = 'openpgp'
 KEY_TYPE_SSH = 'ssh'
 
-try:
-    dbus.validate_bus_name(BUS_NAME)
-except ValueError:
-    # Seahorse isn't installed
-    raise ImportError
-except AttributeError:
-    # Outdated version of DBus that doesn't have validate_bus_name
-    raise ImportError
-
 bus = dbus.SessionBus()
 
-crypto = dbus.Interface(bus.get_object(BUS_NAME, CRYPTO_PATH), 
-                        CRYPTO_INTERFACE)
-openpgp = dbus.Interface(bus.get_object(BUS_NAME, OPENPGP_PATH),
-                         OPENPGP_INTERFACE)
+try: 
+    crypto = dbus.Interface(bus.get_object(BUS_NAME, CRYPTO_PATH), 
+                            CRYPTO_INTERFACE)
+    openpgp = dbus.Interface(bus.get_object(BUS_NAME, OPENPGP_PATH),
+                             OPENPGP_INTERFACE)
+except dbus.exceptions.DBusException, e:
+    if e.get_dbus_name() == 'org.freedesktop.DBus.Error.ServiceUnknown':
+        raise ImportError
+    raise
 
 FLAG_VALID = 0x0001
 FLAG_CAN_ENCRYPT = 0x0002



More information about the Pkg-bazaar-commits mailing list