Example #1
0
def __make_orga_dico__():
	SIGN,SIGN_VAL,DT = [],[],[]
	xdc = libx1.find_files("*.xdc")
	p= Pool(5)
	if xdc[0] == "*.xdc":
		print ("Erreur: Aucun fichier.")
	else:	
		n,e=0,len(xdc)
		while n<e:
			print ("Lecture des signatures de '"+xdc[n]+"' en cours...")
			SIGN,DT = libx1.read_dico_hash_data(xdc[n])
			SIGN_VAL = p.map(f2, SIGN)		
			SIGN_VAL,SIGN,DT=tri_insertion_val(SIGN_VAL,SIGN,DT)
			os.remove(xdc[n])
			libx1.write_file_dico(xdc[n],SIGN,DT)
			n=n+1
Example #2
0
			if len("".join(dta))>100000000:
				print ("Erreur: Le fichier est trop lourd.")
				
			else:
				e=len(dta)
				n=0
				r=hashlib.new('md5')
				r.update("".join(dta))    
				eS=r.digest()
				p = Pool(5)
				sign=p.map(libx1.f_hash_md5, dta)

				tmp=""
				p=''
				print (">>dico")
				libx1.write_file_dico(dico,sign,dta)
				print ("Envoi des signatures")
				UDPSock=socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
				data = "--IN\n" #ENVOI DE LA REQUETE
				addr = (serv_address, 21568)
				UDPSock.sendto(data,addr)
				time.sleep(2)

				data = "".join(dta) #ENVOI DE LA REQUETE
				addr = (serv_address, 21568)
				UDPSock.sendto(data,addr)

				time.sleep(2)
				data = "STOP\n" #ENVOI DE LA REQUETE
				addr = (serv_address, 21568)
				UDPSock.sendto(data,addr)