/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: rodney.dawes at canonical
  • Date: 2008-10-25 06:02:09 UTC
  • Revision ID: rodney.dawes@canonical.com-20081025060209-irlizouino63cs1m
        * preferences/__init__.py:
        Remove the dialog separator
        Remove useless extra call to self._create_pages()
        Make the default window size smaller
        Set the default border width on various widgets
        Set the current notebook page to the first one

        * preferences/identity.py:
        Set various border widths appropriately
        Align the labels to the left
        Remove the unneeded bold markup from the labels
        Change the "User Id" label to "E-Mail"
        Align the radio group labels to the top of the groups

        * preferences/plugins.py:
        Set various border widths appropriately
        Set the default paned position to something more sensible
        Set the shadow type on the treeview's scrolled window to in
        Align the Author and Version labels to the left

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:
36
40
        name = get_name()
37
41
    else:
38
42
        name = getattr(e, '_dbus_error_name', None)
 
43
        
 
44
    if name is None:
 
45
        args = getattr(e, 'args', None) # This is case for old python-dbus-0.62
 
46
        if args == ("Unable to determine the address of the message bus (try 'man dbus-launch' and 'man dbus-daemon' for help)",):
 
47
            raise ImportError
 
48
        
39
49
    # DBus sometimes fails like this, just treat it as if seahorse is not
40
50
    # available rather than crashing.
41
 
    if name == "org.freedesktop.DBus.Error.Spawn.ExecFailed":
 
51
    if name in ("org.freedesktop.DBus.Error.Spawn.ExecFailed", 
 
52
                "org.freedesktop.DBus.Error.ServiceUnknown"):
42
53
        raise ImportError
43
54
    else:
44
55
        raise
45
56
 
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
57
FLAG_VALID = 0x0001
61
58
FLAG_CAN_ENCRYPT = 0x0002
62
59
FLAG_CAN_SIGN = 0x0004
85
82
        if key not in keyset:
86
83
            keyset[key] = Key(key)
87
84
 
88
 
        return keyset[key]
 
85
        return (cleartext, keyset[key])
 
86
 
 
87
    return (cleartext, None)
 
88
 
89
89
 
90
90
class Key:
91
91