diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-12 09:27:39 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-12 09:27:39 +0200 |
commit | 3749d61e1f7a59f5ec5067e560af1eb610c82015 (patch) | |
tree | 73dc228333948738bbe02976cacca8cd382bc978 /Tools/Scripts/webkitpy/common/net/credentials.py | |
parent | b32b4dcd9a51ab8de6afc53d9e17f8707e1f7a5e (diff) | |
download | qtwebkit-3749d61e1f7a59f5ec5067e560af1eb610c82015.tar.gz |
Imported WebKit commit a77350243e054f3460d1137301d8b3faee3d2052 (http://svn.webkit.org/repository/webkit/trunk@125365)
New snapshot with build fixes for latest API changes in Qt and all WK1 Win MSVC fixes upstream
Diffstat (limited to 'Tools/Scripts/webkitpy/common/net/credentials.py')
-rw-r--r-- | Tools/Scripts/webkitpy/common/net/credentials.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/Tools/Scripts/webkitpy/common/net/credentials.py b/Tools/Scripts/webkitpy/common/net/credentials.py index d76405b39..21aeaeafe 100644 --- a/Tools/Scripts/webkitpy/common/net/credentials.py +++ b/Tools/Scripts/webkitpy/common/net/credentials.py @@ -131,9 +131,12 @@ class Credentials(object): return if not User().confirm("Store password in system keyring?", User.DEFAULT_NO): return - self._keyring.set_password(self.host, username, password) + try: + self._keyring.set_password(self.host, username, password) + except: + pass - def read_credentials(self): + def read_credentials(self, user=User): username, password = self._credentials_from_environment() # FIXME: We don't currently support pulling the username from one # source and the password from a separate source. @@ -142,13 +145,17 @@ class Credentials(object): if not username or not password: username, password = self._credentials_from_keychain(username) + if not username: + username = user.prompt("%s login: " % self.host) + if username and not password and self._keyring: - password = self._keyring.get_password(self.host, username) + try: + password = self._keyring.get_password(self.host, username) + except: + pass - if not username: - username = User.prompt("%s login: " % self.host) if not password: - password = User.prompt_password("%s password for %s: " % (self.host, username)) + password = user.prompt_password("%s password for %s: " % (self.host, username)) self._offer_to_store_credentials_in_keyring(username, password) return (username, password) |