Exemplo n.º 1
0
    def __init__(self, fname):
        from dvc.dvcfile import DVC_FILE_SUFFIX, is_dvc_file

        msg = "'{}' is not a DVC-file".format(fname)

        sname = fname + DVC_FILE_SUFFIX
        if is_dvc_file(sname):
            msg += " Do you mean '{}'?".format(sname)

        super().__init__(msg)
Exemplo n.º 2
0
    def __init__(self, fname):
        from dvc.dvcfile import DVC_FILE_SUFFIX, is_dvc_file

        msg = f"'{fname}' is not a DVC-file"

        sname = fname + DVC_FILE_SUFFIX
        if is_dvc_file(sname):
            msg += f" Do you mean '{sname}'?"

        super().__init__(msg)
Exemplo n.º 3
0
def _find_all_targets(repo, target, recursive):
    if os.path.isdir(target) and recursive:
        return [
            fname for fname in Tqdm(
                repo.tree.walk_files(target),
                desc="Searching " + target,
                bar_format=Tqdm.BAR_FMT_NOTOTAL,
                unit="file",
            ) if not repo.is_dvc_internal(fname) if not is_dvc_file(fname)
            if not repo.scm.belongs_to_scm(fname)
            if not repo.scm.is_tracked(fname)
        ]
    return [target]
Exemplo n.º 4
0
def _find_all_targets(repo: "Repo",
                      target: str,
                      recursive: bool = False) -> Iterator[str]:
    from dvc.dvcfile import is_dvc_file

    if os.path.isdir(target) and recursive:
        files = map(os.fspath, repo.dvcignore.walk_files(repo.fs, target))
        yield from (path for path in files if not repo.is_dvc_internal(path)
                    if not is_dvc_file(path)
                    if not repo.scm.belongs_to_scm(path)
                    if not repo.scm.is_tracked(path))
    else:
        yield target
Exemplo n.º 5
0
def _find_all_targets(repo, target, recursive):
    from dvc.dvcfile import is_dvc_file

    if os.path.isdir(target) and recursive:
        return [
            os.fspath(path) for path in Tqdm(
                repo.fs.walk_files(target),
                desc="Searching " + target,
                bar_format=Tqdm.BAR_FMT_NOTOTAL,
                unit="file",
            ) if not repo.is_dvc_internal(os.fspath(path))
            if not is_dvc_file(os.fspath(path))
            if not repo.scm.belongs_to_scm(os.fspath(path))
            if not repo.scm.is_tracked(os.fspath(path))
        ]
    return [target]