From ef89ba67c2218ee79e8533395da92416a8818c86 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Tue, 18 Feb 2020 00:20:51 -0800 Subject: [PATCH] Rename hash_file's callback to callback_progress. --- voussoirkit/spinal.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/voussoirkit/spinal.py b/voussoirkit/spinal.py index 44fffe6..5ed0804 100644 --- a/voussoirkit/spinal.py +++ b/voussoirkit/spinal.py @@ -471,7 +471,7 @@ def copy_file( if validate_hash: verify_hash( destination, - callback=callback_validate_hash, + callback_progress=callback_validate_hash, known_size=source_bytes, known_hash=hasher.hexdigest(), ) @@ -504,11 +504,11 @@ def hash_file( path, hash_class=HASH_CLASS, *, - callback=do_nothing, + callback_progress=do_nothing, chunk_size=CHUNK_SIZE, ): ''' - callback: + callback_progress: A function that takes three parameters: path object, bytes ingested so far, bytes total ''' @@ -525,7 +525,7 @@ def hash_file( break hasher.update(chunk) checked_bytes += len(chunk) - callback(path, checked_bytes, file_size) + callback_progress(path, checked_bytes, file_size) return hasher.hexdigest()