Commit 1a41e03b9be833d23aa6c5eea25fc721db56762d

Authored by Imanol-Mikel Barba Sabariego
1 parent e3ea4c5f

Added progressbar to hash calculation step. BECAUSE I CAN NIGGA

Showing 1 changed file with 13 additions and 1 deletions
digger.py
@@ -6,6 +6,7 @@ sys.path.append('modules') @@ -6,6 +6,7 @@ sys.path.append('modules')
6 sys.path.append('vars') 6 sys.path.append('vars')
7 sys.path.append('logger') 7 sys.path.append('logger')
8 8
  9 +import time
9 import locale 10 import locale
10 from dialog import Dialog 11 from dialog import Dialog
11 import glob 12 import glob
@@ -55,11 +56,22 @@ def bagAndTag(): @@ -55,11 +56,22 @@ def bagAndTag():
55 tombPath = tomb.getPath() 56 tombPath = tomb.getPath()
56 hashes = open(tombPath + "hashes.txt",'a+') 57 hashes = open(tombPath + "hashes.txt",'a+')
57 58
  59 + boneList = []
  60 +
58 for root, dirnames, filenames in os.walk(tombPath): 61 for root, dirnames, filenames in os.walk(tombPath):
59 for dir in dirnames: 62 for dir in dirnames:
60 for subroot, subdirnames, subfilenames in os.walk(tombPath + dir): 63 for subroot, subdirnames, subfilenames in os.walk(tombPath + dir):
61 for filename in subfilenames: 64 for filename in subfilenames:
62 - hashes.write(sha256sum(subroot + "/" + filename) + " " + subroot + "/" + filename + "\n") 65 + boneList.append(subroot + "/" + filename)
  66 +
  67 + d.gauge_start(title="Hashing all collected artifacts...",width=60,height=10)
  68 + boneCount = 0
  69 + for bone in boneList:
  70 + d.gauge_update(text=bone,percent=int(boneCount*100/len(boneList)),update_text=True)
  71 + hashes.write(sha256sum(bone) + " " + bone + "\n")
  72 + boneCount += 1
  73 + d.gauge_update(text="Complete!",percent=100,update_text=True)
  74 + time.sleep(1)
63 hashes.close() 75 hashes.close()
64 76
65 def finish(allSuccessful): 77 def finish(allSuccessful):