[Pkg-bazaar-commits] ./bzr-gtk/unstable r576: Merge seahorse connect improvements.

Jelmer Vernooij jelmer at samba.org
Fri Apr 10 07:44:31 UTC 2009


------------------------------------------------------------
revno: 576
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Fri 2008-07-25 23:36:23 +0200
message:
  Merge seahorse connect improvements.
modified:
  seahorse.py
    ------------------------------------------------------------
    revno: 567.1.1
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: trunk
    timestamp: Wed 2008-07-23 02:07:09 +0200
    message:
      Always try to use seahorse, not just when it has already been started by the 
      user.
    modified:
      seahorse.py
-------------- next part --------------
=== modified file 'seahorse.py'
--- a/seahorse.py	2008-06-29 19:07:23 +0000
+++ b/seahorse.py	2008-07-23 00:07:09 +0000
@@ -30,6 +30,10 @@
 
 try:
     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)
 except dbus.exceptions.DBusException, e:
     get_name = getattr(e, 'get_dbus_name', None)
     if get_name is not None:
@@ -38,25 +42,12 @@
         name = getattr(e, '_dbus_error_name', None)
     # DBus sometimes fails like this, just treat it as if seahorse is not
     # available rather than crashing.
-    if name == "org.freedesktop.DBus.Error.Spawn.ExecFailed":
+    if name in ("org.freedesktop.DBus.Error.Spawn.ExecFailed", 
+                "org.freedesktop.DBus.Error.ServiceUnknown"):
         raise ImportError
     else:
         raise
 
-if hasattr(bus, 'list_activatable_names'):
-    bus_names = bus.list_activatable_names()
-else:
-    bus_object = bus.get_object('org.freedesktop.DBus', '/org/freedesktop/DBus')
-    bus_names = bus_object.ListNames(dbus_interface='org.freedesktop.DBus')
-
-if BUS_NAME not in bus_names:
-    raise ImportError
-
-crypto = dbus.Interface(bus.get_object(BUS_NAME, CRYPTO_PATH), 
-                        CRYPTO_INTERFACE)
-openpgp = dbus.Interface(bus.get_object(BUS_NAME, OPENPGP_PATH),
-                         OPENPGP_INTERFACE)
-
 FLAG_VALID = 0x0001
 FLAG_CAN_ENCRYPT = 0x0002
 FLAG_CAN_SIGN = 0x0004



More information about the Pkg-bazaar-commits mailing list