/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: Sabin Iacob (m0n5t3r)
  • Date: 2008-05-11 11:57:23 UTC
  • mto: This revision was merged to the branch mainline in revision 496.
  • Revision ID: iacobs@m0n5t3r.info-20080511115723-lldd6ci1i1t3aqkz
fix seahorse existence check

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
KEY_TYPE_OPENPGP = 'openpgp'
29
29
KEY_TYPE_SSH = 'ssh'
30
30
 
31
 
try:
32
 
    dbus.validate_bus_name(BUS_NAME)
33
 
except ValueError:
34
 
    # Seahorse isn't installed
35
 
    raise ImportError
36
 
except AttributeError:
37
 
    # Outdated version of DBus that doesn't have validate_bus_name
38
 
    raise ImportError
39
 
 
40
31
bus = dbus.SessionBus()
41
32
 
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)
 
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
46
41
 
47
42
FLAG_VALID = 0x0001
48
43
FLAG_CAN_ENCRYPT = 0x0002