当前位置: 首页>>代码示例>>Python>>正文


Python AnnexRepo.remove_remote方法代码示例

本文整理汇总了Python中datalad.support.annexrepo.AnnexRepo.remove_remote方法的典型用法代码示例。如果您正苦于以下问题:Python AnnexRepo.remove_remote方法的具体用法?Python AnnexRepo.remove_remote怎么用?Python AnnexRepo.remove_remote使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在datalad.support.annexrepo.AnnexRepo的用法示例。


在下文中一共展示了AnnexRepo.remove_remote方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: len

# 需要导入模块: from datalad.support.annexrepo import AnnexRepo [as 别名]
# 或者: from datalad.support.annexrepo.AnnexRepo import remove_remote [as 别名]
        annex._annex_custom_command([], ["git", "annex", "enableremote", "datalad"])
        # go through each and see where urls aren't yet under web
        # seems might have also --in=datalad to restrict
        w = annex.whereis([], options=['--all'], output='full')
        lgr.info("Got %d entries", len(w))
        for k, rec in tqdm(w.items()):
            datalad_urls = get_remote_urls(rec, 'datalad')
            web_urls = set(get_remote_urls(rec, 'web'))
            for url in datalad_urls:
                if url not in web_urls:
                    if 'openneuro.s3' in url or 'openfmri.s3' in url:
                        urls_to_register[k].append(url)
                    else:
                        lgr.warning("Found unexpected url %s" % url)

    finally:
        # disable datalad special remote
        annex.remove_remote("datalad") # need to disable it first
    lgr.info(
        "Got %d entries which could get new urls",
        len(urls_to_register)
    )
    for k, urls in tqdm(urls_to_register.items()):
        for url in urls:
            annex._annex_custom_command(
                [],
                ["git", "annex", "registerurl", '-c', 'annex.alwayscommit=false', k, url]
            )
    # to cause annex to commit all the changes
    annex._annex_custom_command([], ["git", "annex", "merge"])
    annex.gc(allow_background=False)
开发者ID:datalad,项目名称:datalad,代码行数:33,代码来源:copy_urls_from_datalad.py


注:本文中的datalad.support.annexrepo.AnnexRepo.remove_remote方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。