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)
评论列表
文章目录