Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
Be less verbose when getting files
Browse files Browse the repository at this point in the history
  • Loading branch information
itssimon committed Jun 19, 2019
1 parent 2205797 commit d69e493
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pachypy/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ def get_file_content(self, repo: str, path: str, branch: Optional[str] = 'master
return content

def get_files(self, repo: str, glob: str = '**', branch: Optional[str] = 'master', commit: Optional[str] = None,
path: str = '/', destination: Union[str, Path] = '.', ignore_existing: bool = False) -> None:
path: str = '/', destination: Union[str, Path] = '.', ignore_existing: bool = False, verbose: bool = False) -> None:
"""Retrieves multiple files from a repository in PFS and writes them to a local directory.
Args:
Expand All @@ -515,6 +515,7 @@ def get_files(self, repo: str, glob: str = '**', branch: Optional[str] = 'master
path: Path within repository in PFS to retrieve files from.
destination: Local path to write files to. Must be a directory. Will be created if it doesn't exist.
ignore_existing: Whether to ignore or overwrite files that already exist locally.
verbose: Whether to log which files where downloaded.
"""
path = '/' + path.strip('/')
glob = path + '/' + glob
Expand All @@ -527,7 +528,8 @@ def get_files(self, repo: str, glob: str = '**', branch: Optional[str] = 'master
continue
os.makedirs(local_path.parent, exist_ok=True)
self.get_file(repo, path=row['path'], commit=row['commit'], destination=local_path)
self.logger.info(f"Downloaded '{os.path.basename(row['path'])}' to '{local_path.parent}'")
if verbose:
self.logger.info(f"Downloaded '{os.path.basename(row['path'])}' to '{local_path.parent}'")

def create_pipelines(self, pipelines: WildcardFilter = '*', pipeline_specs: Optional[List[dict]] = None,
recreate: bool = False, build_options: Optional[dict] = None) -> PipelineChanges:
Expand Down

0 comments on commit d69e493

Please sign in to comment.