From 1a41e03b9be833d23aa6c5eea25fc721db56762d Mon Sep 17 00:00:00 2001 From: Imanol-Mikel Barba Sabariego Date: Mon, 31 Oct 2016 12:37:30 +0100 Subject: [PATCH] Added progressbar to hash calculation step. BECAUSE I CAN NIGGA --- digger.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/digger.py b/digger.py index 29d57ab..cc424cf 100644 --- a/digger.py +++ b/digger.py @@ -6,6 +6,7 @@ sys.path.append('modules') sys.path.append('vars') sys.path.append('logger') +import time import locale from dialog import Dialog import glob @@ -55,11 +56,22 @@ def bagAndTag(): tombPath = tomb.getPath() hashes = open(tombPath + "hashes.txt",'a+') + boneList = [] + for root, dirnames, filenames in os.walk(tombPath): for dir in dirnames: for subroot, subdirnames, subfilenames in os.walk(tombPath + dir): for filename in subfilenames: - hashes.write(sha256sum(subroot + "/" + filename) + " " + subroot + "/" + filename + "\n") + boneList.append(subroot + "/" + filename) + + d.gauge_start(title="Hashing all collected artifacts...",width=60,height=10) + boneCount = 0 + for bone in boneList: + d.gauge_update(text=bone,percent=int(boneCount*100/len(boneList)),update_text=True) + hashes.write(sha256sum(bone) + " " + bone + "\n") + boneCount += 1 + d.gauge_update(text="Complete!",percent=100,update_text=True) + time.sleep(1) hashes.close() def finish(allSuccessful): -- libgit2 0.22.2