本文整理匯總了Python中datalad.support.annexrepo.AnnexRepo._run_annex_command方法的典型用法代碼示例。如果您正苦於以下問題:Python AnnexRepo._run_annex_command方法的具體用法?Python AnnexRepo._run_annex_command怎麽用?Python AnnexRepo._run_annex_command使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類datalad.support.annexrepo.AnnexRepo
的用法示例。
在下文中一共展示了AnnexRepo._run_annex_command方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _handle_possible_annex_dataset
# 需要導入模塊: from datalad.support.annexrepo import AnnexRepo [as 別名]
# 或者: from datalad.support.annexrepo.AnnexRepo import _run_annex_command [as 別名]
def _handle_possible_annex_dataset(dataset, reckless):
# in any case check whether we need to annex-init the installed thing:
if knows_annex(dataset.path):
# init annex when traces of a remote annex can be detected
if reckless:
lgr.debug(
"Instruct annex to hardlink content in %s from local "
"sources, if possible (reckless)", dataset.path)
dataset.config.add(
'annex.hardlink', 'true', where='local', reload=True)
lgr.debug("Initializing annex repo at %s", dataset.path)
repo = AnnexRepo(dataset.path, init=True)
if reckless:
repo._run_annex_command('untrust', annex_options=['here'])
示例2: _handle_possible_annex_dataset
# 需要導入模塊: from datalad.support.annexrepo import AnnexRepo [as 別名]
# 或者: from datalad.support.annexrepo.AnnexRepo import _run_annex_command [as 別名]
def _handle_possible_annex_dataset(dataset, reckless, description=None):
"""If dataset "knows annex" -- annex init it, set into reckless etc
Provides additional tune up to a possibly an annex repo, e.g.
"enables" reckless mode, sets up description
"""
# in any case check whether we need to annex-init the installed thing:
if not knows_annex(dataset.path):
# not for us
return
# init annex when traces of a remote annex can be detected
if reckless:
lgr.debug(
"Instruct annex to hardlink content in %s from local "
"sources, if possible (reckless)", dataset.path)
dataset.config.add(
'annex.hardlink', 'true', where='local', reload=True)
lgr.debug("Initializing annex repo at %s", dataset.path)
# XXX this is rather convoluted, init does init, but cannot
# set a description without `create=True`
repo = AnnexRepo(dataset.path, init=True)
# so do manually see #1403
if description:
repo._init(description=description)
if reckless:
repo._run_annex_command('untrust', annex_options=['here'])
# go through list of special remotes and issue info message that
# some additional ones are present and were not auto-enabled
remote_names = repo.get_remotes(
with_urls_only=False,
exclude_special_remotes=False)
for k, v in repo.get_special_remotes().items():
sr_name = v.get('name', None)
if sr_name and sr_name not in remote_names:
# if it is not listed among the remotes, it wasn't enabled
lgr.info(
'access to dataset sibling "%s" not auto-enabled, enable with:\n\t\tdatalad siblings -d "%s" enable -s %s',
sr_name,
dataset.path,
sr_name)