From 375d9939bbb41efbdb029d3c3fd687013378b5fb Mon Sep 17 00:00:00 2001 From: root Date: Sat, 24 Dec 2016 06:35:47 +0100 Subject: [PATCH] Finished fixes for last commit --- digger.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/digger.py b/digger.py index f479552..972f258 100644 --- a/digger.py +++ b/digger.py @@ -57,8 +57,8 @@ def sha256sum(file): def bagAndTag(): tombPath = tomb.getPath() if os.path.isfile(tombPath + "MANIFEST.XML"): - etree = xml.etree.ElementTree.parse("MANIFEST.XML") - xmlroot = tree.getroot() + etree = xml.etree.ElementTree.parse(tombPath + "MANIFEST.XML") + xmlroot = etree.getroot() else: xmlroot = xml.etree.ElementTree.Element("Manifest") newElem = xml.etree.ElementTree.Element("Case") @@ -79,11 +79,12 @@ def bagAndTag(): boneCount = 0 evidenceList = xmlroot.find("EvidenceList") for bone in boneList: - if evidenceList.find("./Evidence[@path='" + bone["path"] + "']") != None: + relpath = bone["path"][len(tombPath):] + if evidenceList.find("./Evidence[@path='" + relpath + "']") != None: continue hash = sha256sum(bone["path"]) date = str(int(os.path.getmtime(bone["path"])*1000)) - evidenceList.insert(len(evidenceList),xml.etree.ElementTree.Element("Evidence", hash=hash,path=bone["path"][len(tombPath):],type=bone["type"],date=date)) + evidenceList.insert(len(evidenceList),xml.etree.ElementTree.Element("Evidence", hash=hash,path=relpath,type=bone["type"],date=date)) d.gauge_update(text=bone["path"],percent=int(boneCount*100/len(boneList)),update_text=True) boneCount += 1 d.gauge_update(text="Complete!",percent=100,update_text=True) -- libgit2 0.22.2