MCPcopy
hub / github.com/OfflineIMAP/offlineimap / getpass

Method getpass

offlineimap/ui/TTY.py:79–88  ·  view source on GitHub ↗

TTYUI backend is capable of querying the password.

(self, username, config, errmsg=None)

Source from the content-addressed store, hash-verified

77 return sys.stdout.isatty() and sys.stdin.isatty()
78
79 def getpass(self, username, config, errmsg=None):
80 """TTYUI backend is capable of querying the password."""
81
82 if errmsg:
83 self.warn("%s: %s"% (username, errmsg))
84 self._log_con_handler.acquire() # lock the console output
85 try:
86 return getpass("Enter password for user '%s': " % username)
87 finally:
88 self._log_con_handler.release()
89
90 def mainException(self):
91 if isinstance(sys.exc_info()[1], KeyboardInterrupt):

Callers 2

__getpasswordMethod · 0.45

Calls 3

acquireMethod · 0.80
releaseMethod · 0.80
warnMethod · 0.45

Tested by

no test coverage detected