Skip to content
Snippets Groups Projects
Commit 79ea3e8c authored by Alan De Smet's avatar Alan De Smet
Browse files

Add missing file

parent 755bb6ea
Branches
Tags
No related merge requests found
# python3
# Copyright 2021 University of Wisconsin Regents
#
# This file is part of csppfetch.
#
# csppfetch is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Foobar is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Foobar. If not, see <https://www.gnu.org/licenses/>.
# System modules
import os
import sys
import aitf.ancil
csppfetch = aitf.ancil.csppfetch
human_bytes = csppfetch.human_bytes
class Progress(csppfetch.Progress):
def start_attempt(self, stats):
sys.stderr.write(f"Attempt {stats.current_attempt} out of maximum {stats.max_attempts}\n")
def start_fileset(self, stats):
sys.stderr.write( f" Working on {stats.current_fileset_description}\n")
def finished_file(self, stats, local_path, is_cache_hit):
reason = "downloaded"
if is_cache_hit:
reason = "found in local cache"
sys.stderr.write(f" {os.path.basename(local_path)} {reason}. (Downloaded {len(stats.downloaded_files)} files, {human_bytes(stats.downloaded_size)}. Found in cache {len(stats.cached_files)} files, {human_bytes(stats.cached_size)})\n")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment