Example #1
0
def __make_head_dir__():
	lst_pos = __make_head__()
	os.mkdir("xdc")
	n=0
	while n<len(lst_pos):
		tmp=lst_pos[n]
		os.mkdir("xdc/"+str(ord(tmp[:1]))+"-"+str(ord(tmp[1:])))
		n1=0
		while n1<len(lst_pos):
			tmp1=lst_pos[n1]
			os.mkdir("xdc/"+str(ord(tmp[:1]))+"-"+str(ord(tmp[1:]))+"/"+str(ord(tmp1[:1]))+"-"+str(ord(tmp1[1:])))
			#os.system("touch xdc/"+str(ord(tmp[:1]))+"-"+str(ord(tmp[1:]))+"/"+str(ord(tmp1[:1]))+"-"+str(ord(tmp1[1:])))
			print ("Creation des dossier: ",libx1.prcnt(n,len(lst_pos),5),'-',libx1.prcnt(n1,len(lst_pos),5)+chr(13),sep='',end='')
			n1=n1+1	
		n=n+1
Example #2
0
def __make_head_files__():
	lst_pos = __make_head__()
	n=0
	while n<len(lst_pos):
		tmp=lst_pos[n]
		n1=0
		while n1<len(lst_pos):
			tmp1=lst_pos[n1]
			n2=0
			while n2<len(lst_pos):
				tmp2=lst_pos[n2]
				_dir_ = "xdc/"+str(ord(tmp[:1]))+"-"+str(ord(tmp[1:]))+"/"+str(ord(tmp1[:1]))+"-"+str(ord(tmp1[1:]))
				if os.path.exists(_dir_):
					os.system("touch "+_dir_+"/"+str(ord(tmp2[:1]))+"-"+str(ord(tmp2[1:]))+".xdc")
			
				print ("Creation des fichier: ",libx1.prcnt(n,len(lst_pos),5),'-',libx1.prcnt(n1,len(lst_pos),5),'-',libx1.prcnt(n2,len(lst_pos),5)+chr(13),sep='',end='')
				n2=n2+1
			n1=n1+1	
		n=n+1
Example #3
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 #4
0
def tri_insertion_val(tabl,dt,data):
    for i in range(1,len(tabl)):
	print ("TRI: ",libx1.prcnt(i,len(tabl),5)+chr(13),sep='',end='')
        en_cours=tabl[i]
        en_cours2=dt[i]
	en_cours3=data[i]
        j=i
        #Decalage des elements du tabl
        while j>0 and tabl[j-1]>en_cours:
            tabl[j]=tabl[j-1]
            dt[j]=dt[j-1]
            data[j]=data[j-1]
            j=j-1
        tabl[j]=en_cours
        dt[j]=en_cours2
        data[j]=en_cours3
    print ("\n")
    return tabl, dt, data