/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: Jelmer Vernooij
  • Date: 2008-08-04 18:51:44 UTC
  • Revision ID: jelmer@samba.org-20080804185144-c1v0efzz63zhf790
Remove check for glade.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
try:
32
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)
33
37
except dbus.exceptions.DBusException, e:
34
38
    get_name = getattr(e, 'get_dbus_name', None)
35
39
    if get_name is not None:
38
42
        name = getattr(e, '_dbus_error_name', None)
39
43
    # DBus sometimes fails like this, just treat it as if seahorse is not
40
44
    # available rather than crashing.
41
 
    if name == "org.freedesktop.DBus.Error.Spawn.ExecFailed":
 
45
    if name in ("org.freedesktop.DBus.Error.Spawn.ExecFailed", 
 
46
                "org.freedesktop.DBus.Error.ServiceUnknown"):
42
47
        raise ImportError
43
48
    else:
44
49
        raise
45
50
 
46
 
if hasattr(bus, 'list_activatable_names'):
47
 
    bus_names = bus.list_activatable_names()
48
 
else:
49
 
    bus_object = bus.get_object('org.freedesktop.DBus', '/org/freedesktop/DBus')
50
 
    bus_names = bus_object.ListNames(dbus_interface='org.freedesktop.DBus')
51
 
 
52
 
if BUS_NAME not in bus_names:
53
 
    raise ImportError
54
 
 
55
 
crypto = dbus.Interface(bus.get_object(BUS_NAME, CRYPTO_PATH), 
56
 
                        CRYPTO_INTERFACE)
57
 
openpgp = dbus.Interface(bus.get_object(BUS_NAME, OPENPGP_PATH),
58
 
                         OPENPGP_INTERFACE)
59
 
 
60
51
FLAG_VALID = 0x0001
61
52
FLAG_CAN_ENCRYPT = 0x0002
62
53
FLAG_CAN_SIGN = 0x0004
85
76
        if key not in keyset:
86
77
            keyset[key] = Key(key)
87
78
 
88
 
        return keyset[key]
 
79
        return (cleartext, keyset[key])
 
80
 
 
81
    return (cleartext, None)
 
82
 
89
83
 
90
84
class Key:
91
85