示例#1
0
文件: __init__.py 项目: zjj2wry/dvc
def _get(stage, p, info):
    parsed = urlparse(p)
    if parsed.scheme == 'remote':
        name = Config.SECTION_REMOTE_FMT.format(parsed.netloc)
        sect = stage.project.config.config[name]
        remote = Remote(stage.project, sect)
        return DEP_MAP[remote.scheme](stage, p, info, remote=remote)

    for d in DEPS:
        if d.supported(p):
            return d(stage, p, info)
    return DependencyLOCAL(stage, p, info)
示例#2
0
文件: __init__.py 项目: vibhor98/dvc
def _get(stage, p, info):
    from dvc.utils.compat import urlparse

    parsed = urlparse(p)

    if parsed.scheme == "remote":
        remote = Remote(stage.repo, name=parsed.netloc)
        return DEP_MAP[remote.scheme](stage, p, info, remote=remote)

    for d in DEPS:
        if d.supported(p):
            return d(stage, p, info)
    return DependencyLOCAL(stage, p, info)
示例#3
0
def _get(stage, p, info):
    parsed = urlparse(p)

    if parsed.scheme == "remote":
        remote = Remote(stage.repo, name=parsed.netloc)
        return DEP_MAP[remote.scheme](stage, p, info, remote=remote)

    if info and info.get(DependencyREPO.PARAM_REPO):
        repo = info.pop(DependencyREPO.PARAM_REPO)
        return DependencyREPO(repo, stage, p, info)

    for d in DEPS:
        if d.supported(p):
            return d(stage, p, info)
    return DependencyLOCAL(stage, p, info)
示例#4
0
文件: __init__.py 项目: vasinkd/dvc
def _get(stage, p, info):
    from dvc.utils.compat import urlparse

    parsed = urlparse(p)

    if parsed.scheme == "remote":
        remote = Remote(stage.repo, name=parsed.netloc)
        return DEP_MAP[remote.scheme](stage, p, info, remote=remote)

    if info and info.get(DependencyPKG.PARAM_PKG):
        pkg = info.pop(DependencyPKG.PARAM_PKG)
        return DependencyPKG(pkg, stage, p, info)

    for d in DEPS:
        if d.supported(p):
            return d(stage, p, info)
    return DependencyLOCAL(stage, p, info)