Example #1
0
	def get_spin_f(self,ind=0):
		if var.mode == "decompr":
			xf=libx1.find_files("*.x1")

		if var.mode == "compr":
			xf=libx1.find_files("*.*")

		if ind<1:
			return xf
		if ind>0:
			return xf[ind-1]
Example #2
0
def __organic__():
	SIGN,DT = [],[]
	xdc = libx1.find_files("*.xdc")
	p= Pool(5)
	if os.path.exists("xdc") == False: os.mkdir('xdc')
	xdc.append("///END")
	if xdc[0] == "*.xdc":
		print ("Erreur: Aucun fichier.")
	else:	
		Error_F=0
		n,e=0,len(xdc)
		while n<e:
			
			if Error_F==0:
				if xdc[n]=="///END":
					Error_F=1
					n=e
				else:
					print ("Lecture des signatures de '"+xdc[n]+"' en cours...")
					SIGN,DT = libx1.read_dico_hash_data(xdc[n])
					os.remove(xdc[n])
					tmp_z =p.map(f4, SIGN)
					n1=0
					while n1<len(SIGN):
						tmp="".join(tmp_z[n1])
						a,b,c,d,e,f,g,h,i = tmp[0:][:2].encode('hex'),tmp[2:][:2].encode('hex'),tmp[4:][:2].encode('hex'),tmp[6:][:2].encode('hex'),tmp[8:][:2].encode('hex'),tmp[10:][:2].encode('hex'),tmp[12:][:2].encode('hex'),tmp[14:][:2].encode('hex'),tmp[16:][:2].encode('hex')
						#a,b,c,d = str(ord(a[:1]))+"-"+str(ord(a[1:])),str(ord(b[:1]))+"-"+str(ord(b[1:])),str(ord(c[:1]))+"-"+str(ord(c[1:])),str(ord(d[:1]))+"-"+str(ord(d[1:]))
						#e,f,g,h = str(ord(e[:1]))+"-"+str(ord(e[1:])),str(ord(f[:1]))+"-"+str(ord(f[1:])),str(ord(g[:1]))+"-"+str(ord(g[1:])),str(ord(h[:1]))+"-"+str(ord(h[1:]))
						if os.path.exists("xdc/"+a)==False: os.mkdir("xdc/"+a)
						if os.path.exists("xdc/"+a+"/"+b)==False: os.mkdir("xdc/"+a+"/"+b)
						if os.path.exists("xdc/"+a+"/"+b+"/"+c)==False: os.mkdir("xdc/"+a+"/"+b+"/"+c)
						if os.path.exists("xdc/"+a+"/"+b+"/"+c+"/"+d)==False: os.mkdir("xdc/"+a+"/"+b+"/"+c+"/"+d)
						if os.path.exists("xdc/"+a+"/"+b+"/"+c+"/"+d+"/"+e)==False: os.mkdir("xdc/"+a+"/"+b+"/"+c+"/"+d+"/"+e)
						if os.path.exists("xdc/"+a+"/"+b+"/"+c+"/"+d+"/"+e+"/"+f)==False: os.mkdir("xdc/"+a+"/"+b+"/"+c+"/"+d+"/"+e+"/"+f)
						if os.path.exists("xdc/"+a+"/"+b+"/"+c+"/"+d+"/"+e+"/"+f+"/"+g)==False: os.mkdir("xdc/"+a+"/"+b+"/"+c+"/"+d+"/"+e+"/"+f+"/"+g)
						tmp1 = "xdc/"+a+"/"+b+"/"+c+"/"+d+"/"+e+"/"+f+"/"+g+".xdc"
						t_mp=""
						if os.path.exists(tmp1):
							t_mp=libx1.find_data(SIGN[n1])
						if t_mp=="":
							f=open(tmp1,'append')
							f.write(SIGN[n1]+DT[n1])
							f.close()
						else:
							print ("La signature existe deja!")
						print (tmp.encode('hex'),' - ',tmp1, "-", libx1.prcnt(n1,len(SIGN),5))
						n1=n1+1
					n=n+1
Example #3
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