/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: Vincent Ladeuil
  • Date: 2008-05-05 18:16:46 UTC
  • mto: (487.1.1 gtk)
  • mto: This revision was merged to the branch mainline in revision 490.
  • Revision ID: v.ladeuil+lp@free.fr-20080505181646-n95l8ltw2u6jtr26
Fix bug #187283 fix replacing _() by _i18n().

* genpot.sh 
Remove duplication. Add the ability to specify the genrated pot
file on command-line for debugging purposes.

* po/olive-gtk.pot:
Regenerated.

* __init__.py, branch.py, branchview/treeview.py, checkout.py,
commit.py, conflicts.py, diff.py, errors.py, initialize.py,
merge.py, nautilus-bzr.py, olive/__init__.py, olive/add.py,
olive/bookmark.py, olive/guifiles.py, olive/info.py,
olive/menu.py, olive/mkdir.py, olive/move.py, olive/remove.py,
olive/rename.py, push.py, revbrowser.py, status.py, tags.py:
Replace all calls to _() by calls to _i18n(), the latter being
defined in __init__.py and imported in the other modules from
there. This fix the problem encountered countless times when
running bzr selftest and getting silly error messages about
boolean not being callables.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
KEY_TYPE_SSH = 'ssh'
30
30
 
31
31
try:
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
 
 
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
 
 
49
 
    # DBus sometimes fails like this, just treat it as if seahorse is not
50
 
    # available rather than crashing.
51
 
    if name in ("org.freedesktop.DBus.Error.Spawn.ExecFailed", 
52
 
                "org.freedesktop.DBus.Error.ServiceUnknown",
53
 
                "org.freedesktop.DBus.Error.NotSupported"):
54
 
        raise ImportError
55
 
    else:
56
 
        raise
 
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)
57
42
 
58
43
FLAG_VALID = 0x0001
59
44
FLAG_CAN_ENCRYPT = 0x0002
83
68
        if key not in keyset:
84
69
            keyset[key] = Key(key)
85
70
 
86
 
        return (cleartext, keyset[key])
87
 
 
88
 
    return (cleartext, None)
89
 
 
 
71
        return keyset[key]
90
72
 
91
73
class Key:
92
74