def auth_interactive_dumb(self, username, handler=None, submethods=''):
"""
Autenticate to the server interactively but dumber.
Just print the prompt and / or instructions to stdout and send back
the response. This is good for situations where partial auth is
achieved by key and then the user has to enter a 2fac token.
"""
if not handler:
def handler(title, instructions, prompt_list):
answers = []
if title:
print(title.strip())
if instructions:
print(instructions.strip())
for prompt,show_input in prompt_list:
print(prompt.strip(),end=' ')
answers.append(raw_input())
return answers
return self.auth_interactive(username, handler, submethods)
评论列表
文章目录