/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to seahorse.py

  • Committer: Scott Scriven
  • Date: 2008-06-07 09:00:24 UTC
  • mto: This revision was merged to the branch mainline in revision 507.
  • Revision ID: ubuntu@toykeeper.net-20080607090024-sg8nzg1hgqmzj27v
Simpler/cleaner way to ignore the 'close' signal.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
bus = dbus.SessionBus()
32
32
 
33
 
try: 
34
 
    crypto = dbus.Interface(bus.get_object(BUS_NAME, CRYPTO_PATH), 
35
 
                            CRYPTO_INTERFACE)
36
 
    openpgp = dbus.Interface(bus.get_object(BUS_NAME, OPENPGP_PATH),
37
 
                             OPENPGP_INTERFACE)
38
 
except dbus.exceptions.DBusException, e:
39
 
    if e.get_dbus_name() == 'org.freedesktop.DBus.Error.ServiceUnknown':
40
 
        raise ImportError
41
 
    raise
 
33
if hasattr(bus, 'list_activatable_names'):
 
34
    bus_names = bus.list_activatable_names()
 
35
else:
 
36
    bus_object = bus.get_object('org.freedesktop.DBus', '/org/freedesktop/DBus')
 
37
    bus_names = bus_object.ListNames(dbus_interface='org.freedesktop.DBus')
 
38
 
 
39
if BUS_NAME not in bus_names:
 
40
    raise ImportError
 
41
 
 
42
crypto = dbus.Interface(bus.get_object(BUS_NAME, CRYPTO_PATH), 
 
43
                        CRYPTO_INTERFACE)
 
44
openpgp = dbus.Interface(bus.get_object(BUS_NAME, OPENPGP_PATH),
 
45
                         OPENPGP_INTERFACE)
42
46
 
43
47
FLAG_VALID = 0x0001
44
48
FLAG_CAN_ENCRYPT = 0x0002