Example #1
0
 def _buildCollection(self, f06FilePaths):
     # collects f06File objects in self
     # keyed by hash ID
     for filePath in f06FilePaths:
         f06 = f06File(filePath)
         f06.scanHeaders()
         f06.closeFile()
         self.files[f06.getHash()] = f06
Example #2
0
 def checkForUpdates(self):
     # checks each file for same hash ID
     # if hash ID is different, the file is updated
     badFiles = []
     newFiles = []
     for (hashKey, f06) in self.files.items():
         try: f06Temp = f06File(f06.filename)
         except: 
             raise IOError, "could not find: %s" % f06.filename
             # highlight file row
             badFiles.append(f06.filename)
             continue
         if f06Temp.getHash() == hashKey: pass
         else: 
             newFiles.append(f06.filename)
             badFiles.append(hashKey)
     for filename in badFiles:
         self.removeFile(filename)
     for filename in newFiles:
         self.addFile(filename)
         print "updated: %s" % filename
Example #3
0
 def addFile(self, filename):
     # adds filename with associated hash ID as key
     f06 = f06File(filename)
     f06.scanHeaders()
     f06.closeFile()
     self.files[f06.getHash()] = f06