utils.py 文件源码

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

项目:nlppln 作者: nlppln 项目源码 文件源码
def copy_cwl_files(from_dir=CWL_PATH):
    """Copy cwl files to a directory where the cwl-runner can find them.

    cwl files are copied to $XDG_DATA_HOME/commonwl/ This is one of the default
    locations where the cwl-runner looks for cwl files.

    Args:
        from_dir (str): Path to directory where to copy files from (default:
            the cwl directory of nlppln).
    """
    cwl_data_dir = os.environ.get('XDG_DATA_HOME')
    if not cwl_data_dir:
        cwl_data_dir = DEFAULT_DATA_DIR

    cwl_data_dir = os.path.join(cwl_data_dir, CWL_DATA_DIR_PREFIX)

    create_dirs(cwl_data_dir)

    cwl_files = glob.glob('{}{}*.cwl'.format(from_dir, os.sep))
    for fi in cwl_files:
        fo = os.path.join(cwl_data_dir, os.path.basename(fi))
        shutil.copy2(fi, fo)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号