Print username instead of accountname when asking for password

When asking for a password interactively, the username is never
displayed which may hide problems (typos on the configuration, or
issues on offlineimap parsing of the config file).  The hostname,
port, and account name are already displayed when establishing the
connection.  When asking for password, the account name is displayed
again.  Change it to display the username.

Github-ref: https://github.com/OfflineIMAP/offlineimap/issues/558
Signed-off-by: David Miguel Susano Pinto <carandraug+dev@gmail.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Carnë Draug
2018-06-13 13:05:13 +01:00
committed by Nicolas Sebrecht
parent 11313a9b9c
commit 5f9474e10d
5 changed files with 11 additions and 12 deletions

View File

@ -175,8 +175,7 @@ class IMAPServer(object):
# get 1) configured password first 2) fall back to asking via UI
self.password = self.repos.getpassword() or \
self.ui.getpass(self.repos.getname(), self.config,
self.passworderror)
self.ui.getpass(self.username, self.config, self.passworderror)
self.passworderror = None
return self.password