예제 #1
0
    def open(self):
        if not self.options.dbfile:
            self.options.parser.error('No filename list given')
            return False

        if not os.access(self.options.dbfile, os.R_OK):
            self.options.parser.error('Unable to open filename list %s' %
                                      self.options.dbfile)
            return False

        with open(self.options.dbfile, 'r') as f:
            for line in f:
                cleaned_file = line.strip().replace('/', '\\')
                base_fname = os.path.splitext(cleaned_file)[0]

                hash_value = jenkins.hashlittle2(cleaned_file.upper())
                self.files[(hash_value[0] << 32)
                           | hash_value[1]] = cleaned_file

                for ext in ['.db2', '.dbc']:
                    final_file = base_fname + ext
                    hash_value = jenkins.hashlittle2(final_file.upper())

                    self.files[(hash_value[0] << 32)
                               | hash_value[1]] = final_file

        return True
예제 #2
0
	def open(self):
		if not self.options.dbfile:
			print self.options.parser('No filename list given')
			return False

		if not os.access(self.options.dbfile, os.R_OK):
			print self.options.parser('Unable to open filename list %s' % self.options.dbfile)
			return False

		with open(self.options.dbfile, 'r') as f:
			for line in f:
				cleaned_file = line.strip().replace('/', '\\')
				base_fname = os.path.splitext(cleaned_file)[0]

				for ext in [ '.db2', '.dbc' ]:
					final_file = base_fname + ext
					hash_value = jenkins.hashlittle2(final_file.upper())

					self.files[(hash_value[0] << 32) | hash_value[1]] = final_file

		return True
예제 #3
0
파일: casc.py 프로젝트: pasfomp/simc-1
 def GetFileMD5(self, file):
     hash_name = file.strip().upper().replace('/', '\\')
     hash = jenkins.hashlittle2(hash_name)
     v = (hash[0] << 32) | hash[1]
     return self.hash_map.get(v, [])
예제 #4
0
파일: casc.py 프로젝트: Ambalus/simc
	def GetFileMD5(self, file):
		hash_name = file.strip().upper().replace('/', '\\')
		hash = jenkins.hashlittle2(hash_name)
		v = (hash[0] << 32) | hash[1]
		return self.hash_map.get(v, [])