warhorn.py 文件源码

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

项目:warriorframework 作者: warriorframework 项目源码 文件源码
def replace_tools_from_product_repo(node_list, **kwargs):
    """ This will clone the tools from product repo and then replaces
        tools directory in warrior main with this tools repo.
    """
    logfile = kwargs.get("logfile")
    config_file_name = kwargs.get("config_file_name")
    console_log_name = kwargs.get("console_log_name")
    print_log_name = kwargs.get("print_log_name")
    if "tools" in node_list:
        tools_node = get_node(config_file_name, "tools")
        tools_url = get_attribute_value(tools_node, "url")
        tools_root = get_repository_name(tools_url)
        tools_clone = get_attribute_value(tools_node, "clone")
        tools_base_path = ""
        warrior_node = get_node(config_file_name, "warriorframework")
        warrior_base_path = get_attribute_value(warrior_node, "destination")
        if tools_url and tools_clone == "yes":
            tools_base_path = validate_base_path(
                tools_base_path, logfile=logfile,
                config_file_name=config_file_name,
                console_log_name=console_log_name,
                print_log_name=print_log_name)
            warrior_base_path = validate_base_path(
                warrior_base_path, logfile=logfile,
                config_file_name=config_file_name,
                console_log_name=console_log_name, print_log_name=print_log_name)
            warrior_tools_path = os.path.join(warrior_base_path,
                                                  "warrior", "Tools")
            product_tools_path = os.path.join(tools_base_path, tools_root, "Tools")
            dir_util.copy_tree(product_tools_path, warrior_tools_path, update=1)
            delete_directory(os.path.join(tools_base_path, tools_root), logfile, print_log_name)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号