cli.py 文件源码

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

项目:ngage 作者: 20c 项目源码 文件源码
def connect(self, kwargs):
        try:
            # get config
            config = self.get_connect_config(kwargs)

            typ = config['type']
            # check for subtype
            if ':' in typ:
                typ = config['type'].split(':', 1)[0]

            cls = ngage.plugin.get_plugin_class(typ)
            drv = cls(config)
            self.log.debug("connecting to {host}".format(**config))
            drv.open()
            return drv

        except AuthenticationError:
            config['password'] = click.prompt('password', hide_input=True)
            if config['password']:
                return connect(config)
            raise
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号