def update_hash_dict(filehash, filename):
 try:
  with open((file_path + '/hash_dict.pickle'), 'rb') as f:
   hash_dict = cPickle.load(f)
 except IOError:
  hash_dict = {}
 hash_dict.update({filename: filehash})
 with open(os.path.join(file_path, 'hash_dict.pickle'), 'wb') as f:
  cPickle.dump(hash_dict, f)

def update_hash_dict ( filehash , filename ) : try : with open ( ( file_path + '/hash_dict.pickle' ) , 'rb' ) as f : hash_dict = cPickle . load ( f ) except IOError : hash_dict = { } hash_dict . update ( { filename : filehash } ) with open ( os . path . join ( file_path , 'hash_dict.pickle' ) , 'wb' ) as f : cPickle . dump ( hash_dict , f )
opens the pickled hash dictionary .