/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: Jasper Groenewegen
  • Date: 2008-07-27 12:01:40 UTC
  • mfrom: (576.3.2 improve-merge)
  • mto: This revision was merged to the branch mainline in revision 579.
  • Revision ID: colbrac@xs4all.nl-20080727120140-1agdlzkc9fumjk5f
Merge merge dialog improvements

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
KEY_TYPE_SSH = 'ssh'
30
30
 
31
31
try:
32
 
    dbus.validate_bus_name(BUS_NAME)
33
 
except ValueError:
34
 
    raise ImportError
35
 
 
36
 
bus = dbus.SessionBus()
37
 
 
38
 
crypto = dbus.Interface(bus.get_object(BUS_NAME, CRYPTO_PATH), 
39
 
                        CRYPTO_INTERFACE)
40
 
openpgp = dbus.Interface(bus.get_object(BUS_NAME, OPENPGP_PATH),
41
 
                         OPENPGP_INTERFACE)
 
32
    bus = dbus.SessionBus()
 
33
    crypto = dbus.Interface(bus.get_object(BUS_NAME, CRYPTO_PATH), 
 
34
                            CRYPTO_INTERFACE)
 
35
    openpgp = dbus.Interface(bus.get_object(BUS_NAME, OPENPGP_PATH),
 
36
                             OPENPGP_INTERFACE)
 
37
except dbus.exceptions.DBusException, e:
 
38
    get_name = getattr(e, 'get_dbus_name', None)
 
39
    if get_name is not None:
 
40
        name = get_name()
 
41
    else:
 
42
        name = getattr(e, '_dbus_error_name', None)
 
43
    # DBus sometimes fails like this, just treat it as if seahorse is not
 
44
    # available rather than crashing.
 
45
    if name in ("org.freedesktop.DBus.Error.Spawn.ExecFailed", 
 
46
                "org.freedesktop.DBus.Error.ServiceUnknown"):
 
47
        raise ImportError
 
48
    else:
 
49
        raise
42
50
 
43
51
FLAG_VALID = 0x0001
44
52
FLAG_CAN_ENCRYPT = 0x0002
68
76
        if key not in keyset:
69
77
            keyset[key] = Key(key)
70
78
 
71
 
        return keyset[key]
 
79
        return (cleartext, keyset[key])
 
80
 
 
81
    return (cleartext, None)
 
82
 
72
83
 
73
84
class Key:
74
85