Пример #1
0
            except Exception, msg:
                try:
                    os.makedirs(extractDirPath)
                    fout = open(extractFilePath, 'wb')
                except Exception, value:
                    self.errorLog.write('%s; UnzipError: %s\n'%(extractFilePath, value))
                    self.errorLog.flush()
                    #print 'Error occured: msg:: ', msg
                    
            if fout:
                fout.write(buffer)
                fout.close()
                
            MD5 = "N/A"
            KnownFile = 0
            hashes = CommonFunctions.GetBufferHashesAsDict(buffer, MD5=True, SHA1=False)
            if hashes:
                if self.dbNSRL:
                    if self.CheckMD5Hash(self.dbNSRL, hashes['MD5']):
                        self.knownFilesLog.write("%s \t %s \n"%(extractFilePath, hashes['MD5']))
                        KnownFilesCount += 1
                        #continue
                        KnownFile = 1
                        
                MD5 = hashes['MD5']

            Name = unzipFileName
            
            DirPath = unzipDirPath #os.path.join(zipFilePath, unzipDirName)
            NewPath = extractFilePath.replace(Globals.CasePath, "")