diff --git a/offlineimap/imapserver.py b/offlineimap/imapserver.py index 9075b80..79163f2 100644 --- a/offlineimap/imapserver.py +++ b/offlineimap/imapserver.py @@ -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 diff --git a/offlineimap/ui/Curses.py b/offlineimap/ui/Curses.py index e97bed0..04119aa 100644 --- a/offlineimap/ui/Curses.py +++ b/offlineimap/ui/Curses.py @@ -549,7 +549,7 @@ class Blinkenlights(UIBase, CursesUtil): def mainException(self): UIBase.mainException(self) - def getpass(self, accountname, config, errmsg=None): + def getpass(self, username, config, errmsg=None): # disable the hotkeys inputhandler self.inputhandler.input_acquire() @@ -558,8 +558,8 @@ class Blinkenlights(UIBase, CursesUtil): try: #s.gettf().setcolor('white') self.warn(" *** Input Required") - self.warn(" *** Please enter password for account %s: " % \ - accountname) + self.warn(" *** Please enter password for user '%s': " % \ + username) self.logwin.refresh() password = self.logwin.getstr() finally: diff --git a/offlineimap/ui/Machine.py b/offlineimap/ui/Machine.py index ae3eab8..ed0411e 100644 --- a/offlineimap/ui/Machine.py +++ b/offlineimap/ui/Machine.py @@ -182,15 +182,15 @@ class MachineUI(UIBase): return 0 - def getpass(s, accountname, config, errmsg=None): + def getpass(s, username, config, errmsg=None): if errmsg: s._printData(s.logger.warning, - 'getpasserror', "%s\n%s"% (accountname, errmsg), + 'getpasserror', "%s\n%s"% (username, errmsg), False) s._log_con_handler.acquire() # lock the console output try: - s._printData(s.logger.info, 'getpass', accountname) + s._printData(s.logger.info, 'getpass', username) return (sys.stdin.readline()[:-1]) finally: s._log_con_handler.release() diff --git a/offlineimap/ui/TTY.py b/offlineimap/ui/TTY.py index 7113b6a..5a0a517 100644 --- a/offlineimap/ui/TTY.py +++ b/offlineimap/ui/TTY.py @@ -76,14 +76,14 @@ class TTYUI(UIBase): return sys.stdout.isatty() and sys.stdin.isatty() - def getpass(self, accountname, config, errmsg=None): + def getpass(self, username, config, errmsg=None): """TTYUI backend is capable of querying the password.""" if errmsg: - self.warn("%s: %s"% (accountname, errmsg)) + self.warn("%s: %s"% (username, errmsg)) self._log_con_handler.acquire() # lock the console output try: - return getpass("Enter password for account '%s': " % accountname) + return getpass("Enter password for user '%s': " % username) finally: self._log_con_handler.release() diff --git a/offlineimap/ui/UIBase.py b/offlineimap/ui/UIBase.py index 10993ff..94f9f02 100644 --- a/offlineimap/ui/UIBase.py +++ b/offlineimap/ui/UIBase.py @@ -257,7 +257,7 @@ class UIBase(object): ################################################## INPUT - def getpass(self, accountname, config, errmsg = None): + def getpass(self, username, config, errmsg = None): raise NotImplementedError("Prompting for a password is not supported" " in this UI backend.")