robot.py 文件源码

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

项目:flux_line_bot 作者: blesscat 项目源码 文件源码
def python_shell(options):
    logger = setup_logger("Robot", debug=options.verbose)

    def conn_callback(*args):
        sys.stdout.write(".")
        sys.stdout.flush()
        return True

    if options.shell == "ipython":
        import IPython
    else:
        import importlib
        sys.path.append(os.path.abspath(""))
        module_name, entrance_name = options.shell.rsplit(".", 1)
        module_instance = importlib.import_module(module_name)
        entrance = module_instance.__getattribute__(entrance_name)

    robot, device = connect_robot_helper(options.target, options.clientkey)

    if options.shell == "ipython":
        logger.info("----> READY")
        logger.info("""
      * Hint: Try 'robot?' and 'dir(robot)' to get more informations)\n""")
        IPython.embed()
        return 0
    else:
        return entrance(robot, device)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号