/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 keyring.py

  • Committer: Mark Lee
  • Date: 2009-07-11 18:39:14 UTC
  • mto: This revision was merged to the branch mainline in revision 661.
  • Revision ID: bzr@lazymalevolence.com-20090711183914-zuii3et5skiv2njo
Re-ignore credits.pickle.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
    def __init__(self):
31
31
        CredentialStore.__init__(self)
32
 
        # Older versions of gobject don't provide get_application_name so we
33
 
        # can't always check.
34
 
        get_app_name = getattr(gobject, 'get_application_name', None)
35
 
        if get_app_name is None or get_app_name() is None:
36
 
            # External applications that load bzrlib may already have set the
37
 
            # application name so we don't contradict them (when we can
38
 
            # determine it that is).
 
32
        # External apps that load bzrlib may also set this, so 
 
33
        # don't override:
 
34
        if gobject.get_application_name() is None:
39
35
            gobject.set_application_name("bzr")
40
36
 
41
37
    def decode_password(self, credentials):
77
73
                gnomekeyring.ITEM_NETWORK_PASSWORD, attrs)
78
74
            credentials["user"] = items[0].attributes["user"]
79
75
            credentials["password"] = items[0].secret
80
 
        except (gnomekeyring.NoMatchError, gnomekeyring.DeniedError, gnomekeyring.NoKeyringDaemonError,
81
 
                gnomekeyring.IOError), e:
82
 
            from bzrlib import trace
83
 
            trace.mutter('Unable to obtain credentials for %r from GNOME keyring: %r',
84
 
                         attrs, e)
 
76
        except (gnomekeyring.NoMatchError, gnomekeyring.DeniedError, gnomekeyring.NoKeyringDaemonError):
85
77
            return None