本文整理汇总了Python中datalad.support.annexrepo.AnnexRepo.get_indexed_files方法的典型用法代码示例。如果您正苦于以下问题:Python AnnexRepo.get_indexed_files方法的具体用法?Python AnnexRepo.get_indexed_files怎么用?Python AnnexRepo.get_indexed_files使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类datalad.support.annexrepo.AnnexRepo
的用法示例。
在下文中一共展示了AnnexRepo.get_indexed_files方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ok_file_under_git
# 需要导入模块: from datalad.support.annexrepo import AnnexRepo [as 别名]
# 或者: from datalad.support.annexrepo.AnnexRepo import get_indexed_files [as 别名]
def ok_file_under_git(path, filename, annexed=False):
repo = AnnexRepo(path)
assert(filename in repo.get_indexed_files()) # file is known to Git
try:
repo.get_file_key(filename)
in_annex = True
except FileNotInAnnexError as e:
in_annex = False
assert(annexed == in_annex)
示例2: test_AnnexRepo_annex_add_to_git
# 需要导入模块: from datalad.support.annexrepo import AnnexRepo [as 别名]
# 或者: from datalad.support.annexrepo.AnnexRepo import get_indexed_files [as 别名]
def test_AnnexRepo_annex_add_to_git(src, dst):
ar = AnnexRepo(dst, src)
filename = 'file_to_git.dat'
filename_abs = os.path.join(dst, filename)
with open(filename_abs, 'w') as f:
f.write("What to write?")
assert_raises(IOError, ar.get_file_key, filename)
ar.annex_add_to_git(filename)
assert_in(filename, ar.get_indexed_files())