Commit 375d9939bbb41efbdb029d3c3fd687013378b5fb

Authored by root
1 parent 2f2e7aff

Finished fixes for last commit

Showing 1 changed file with 5 additions and 4 deletions
digger.py
... ... @@ -57,8 +57,8 @@ def sha256sum(file):
57 57 def bagAndTag():
58 58 tombPath = tomb.getPath()
59 59 if os.path.isfile(tombPath + "MANIFEST.XML"):
60   - etree = xml.etree.ElementTree.parse("MANIFEST.XML")
61   - xmlroot = tree.getroot()
  60 + etree = xml.etree.ElementTree.parse(tombPath + "MANIFEST.XML")
  61 + xmlroot = etree.getroot()
62 62 else:
63 63 xmlroot = xml.etree.ElementTree.Element("Manifest")
64 64 newElem = xml.etree.ElementTree.Element("Case")
... ... @@ -79,11 +79,12 @@ def bagAndTag():
79 79 boneCount = 0
80 80 evidenceList = xmlroot.find("EvidenceList")
81 81 for bone in boneList:
82   - if evidenceList.find("./Evidence[@path='" + bone["path"] + "']") != None:
  82 + relpath = bone["path"][len(tombPath):]
  83 + if evidenceList.find("./Evidence[@path='" + relpath + "']") != None:
83 84 continue
84 85 hash = sha256sum(bone["path"])
85 86 date = str(int(os.path.getmtime(bone["path"])*1000))
86   - evidenceList.insert(len(evidenceList),xml.etree.ElementTree.Element("Evidence", hash=hash,path=bone["path"][len(tombPath):],type=bone["type"],date=date))
  87 + evidenceList.insert(len(evidenceList),xml.etree.ElementTree.Element("Evidence", hash=hash,path=relpath,type=bone["type"],date=date))
87 88 d.gauge_update(text=bone["path"],percent=int(boneCount*100/len(boneList)),update_text=True)
88 89 boneCount += 1
89 90 d.gauge_update(text="Complete!",percent=100,update_text=True)
... ...