transport.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:obsoleted-vpduserv 作者: InfraSIM 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号