#!/opt/csw/bin/python
# -*- coding: latin1 -*-
import sys
# En entree, on peut mettre autant de numero de glyphes que l'on veut
numArgs = len(sys.argv) - 1
if numArgs < 1:
print 'Usage: orientationEpaisseur numeros_Glyphe'
sys.exit(1)
else:
numeros = sys.argv[1:]
effetDict = {}
effetDict[1320] = ['ATT','ATT']
effetDict[2344] = ['ATT','ESQ']
effetDict[3368] = ['ATT','DEG']
effetDict[4392] = ['ATT','ARM']
effetDict[5416] = ['ATT','REG']
effetDict[6440] = ['ATT','VUE']
effetDict[7464] = ['ATT','PV']
effetDict[8456] = ['ATT','TOUR']
effetDict[9512] = ['ATT','Duree']
effetDict[10536] = ['ATT','EffZone']
effetDict[11560] = ['ESQ','ATT']
effetDict[12584] = ['ESQ','ESQ']
effetDict[13608] = ['ESQ','DEG']
effetDict[14632] = ['ESQ','ARM']
effetDict[15656] = ['ESQ','REG']
effetDict[16680] = ['ESQ','VUE']
effetDict[17704] = ['ESQ','PV']
effetDict[18728] = ['ESQ','TOUR']
effetDict[19752] = ['ESQ','Duree']
effetDict[20776] = ['ESQ','EffZone']
effetDict[21800] = ['DEG','ATT']
effetDict[22824] = ['DEG','ESQ']
effetDict[23848] = ['DEG','DEG']
effetDict[24872] = ['DEG','ARM']
effetDict[25896] = ['DEG','REG']
effetDict[26920] = ['DEG','VUE']
effetDict[27944] = ['DEG','PV']
effetDict[28968] = ['DEG','TOUR']
effetDict[29992] = ['DEG','Duree']
effetDict[31016] = ['DEG','EffZone']
effetDict[32040] = ['ARM','ATT']
effetDict[33064] = ['ARM','ESQ']
effetDict[34088] = ['ARM','DEG']
effetDict[35112] = ['ARM','ARM']
effetDict[36136] = ['ARM','REG']
effetDict[37160] = ['ARM','VUE']
effetDict[38184] = ['ARM','PV']
effetDict[39208] = ['ARM','TOUR']
effetDict[40232] = ['ARM','Duree']
effetDict[41256] = ['ARM','EffZone']
effetDict[42280] = ['REG','ATT']
effetDict[43304] = ['REG','ESQ']
effetDict[44328] = ['REG','DEG']
effetDict[45352] = ['REG','ARM']
effetDict[46376] = ['REG','REG']
effetDict[47400] = ['REG','VUE']
effetDict[48424] = ['REG','PV']
effetDict[49448] = ['REG','TOUR']
effetDict[50472] = ['REG','Duree']
effetDict[51496] = ['REG','EffZone']
effetDict[52520] = ['VUE','ATT']
effetDict[53544] = ['VUE','ESQ']
effetDict[54568] = ['VUE','DEG']
effetDict[55592] = ['VUE','ARM']
effetDict[56616] = ['VUE','REG']
effetDict[57640] = ['VUE','VUE']
effetDict[58664] = ['VUE','PV']
effetDict[59688] = ['VUE','TOUR']
effetDict[60712] = ['VUE','Duree']
effetDict[61736] = ['VUE','EffZone']
effetDict[62760] = ['PV','ATT']
effetDict[63784] = ['PV','ESQ']
effetDict[64808] = ['PV','DEG']
effetDict[65832] = ['PV','ARM']
effetDict[66856] = ['PV','REG']
effetDict[67880] = ['PV','VUE']
effetDict[68904] = ['PV','PV']
effetDict[69928] = ['PV','TOUR']
effetDict[70952] = ['PV','Duree']
effetDict[71976] = ['PV','EffZone']
effetDict[73000] = ['TOUR','ATT']
effetDict[74024] = ['TOUR','ESQ']
effetDict[75048] = ['TOUR','DEG']
effetDict[76072] = ['TOUR','ARM']
effetDict[77096] = ['TOUR','REG']
effetDict[78120] = ['TOUR','VUE']
effetDict[79144] = ['TOUR','PV']
effetDict[80168] = ['TOUR','TOUR']
effetDict[81192] = ['TOUR','Duree']
effetDict[82216] = ['TOUR','EffZone']
effetDict[83240] = ['Duree','ATT']
effetDict[84264] = ['Duree','ESQ']
effetDict[85288] = ['Duree','DEG']
effetDict[86312] = ['Duree','ARM']
effetDict[87336] = ['Duree','REG']
effetDict[88360] = ['Duree','VUE']
effetDict[89384] = ['Duree','PV']
effetDict[90408] = ['Duree','TOUR']
effetDict[91432] = ['Duree','Duree']
effetDict[92456] = ['Duree','EffZone']
effetDict[93480] = ['EffZone','ATT']
effetDict[94504] = ['EffZone','ESQ']
effetDict[95528] = ['EffZone','DEG']
effetDict[96552] = ['EffZone','ARM']
effetDict[97576] = ['EffZone','REG']
effetDict[98600] = ['EffZone','VUE']
effetDict[99624] = ['EffZone','PV']
effetDict[100648] = ['EffZone','TOUR']
effetDict[101672] = ['EffZone','Duree']
effetDict[102696] = ['EffZone','EffZone']
epaisseurDict = {}
epaisseurDict[0] = 'T.gras'
epaisseurDict[1] = 'Gras'
epaisseurDict[2] = 'Moyen'
epaisseurDict[3] = 'Fin'
epaisseurDict[4] = 'T.fin'
epaisseurDict[5] = 'T.fin'
epaisseurDict[6] = 'T.fin'
orientationDict = {}
orientationDict[0] = 'Initiale'
orientationDict[1] = 'Sym. Hor.'
orientationDict[2] = 'Sym. Vert.'
orientationDict[3] = 'Sym. Cent.'
#Si le numero est impair, on utilise le numero pair le precedant
for i in range(len(numeros)):
numeros[i] = int(numeros[i] )
if numeros[i]%2==1:
numeros[i] -=1
numeroDeb = 1288
intervalle = 1024
print
print 'Numero Glyphe \tEpais.\tOrientation\tCaracterist.1\tCaracterist.2\tRepere Tableau'
# boucle sur les numeros donnes en entree
for num in numeros:
debFamille = int((num-numeroDeb)/intervalle)*intervalle+numeroDeb
repereTableau = debFamille+32
epaisseur = int((num-debFamille)/8)
orientation = (num-debFamille)/2%4
strOut = 'Numero '+str(num) + '\t' + epaisseurDict[epaisseur] + '\t'+orientationDict[orientation]+ '\t'
if epaisseur == 0:
if orientation==0 or orientation==1:
strOut += effetDict[repereTableau][0] + ' Bonus\t---------\t'
else:
strOut += effetDict[repereTableau][0] + ' Malus\t---------\t'
else:
if orientation==0:
strOut += effetDict[repereTableau][0] + ' Bonus\t' + effetDict[repereTableau][1] + ' Malus\t'
if orientation==1:
strOut += effetDict[repereTableau][0] + ' Bonus\t' + effetDict[repereTableau][1] + ' Bonus\t'
if orientation==2:
strOut += effetDict[repereTableau][0] + ' Malus\t' + effetDict[repereTableau][1] + ' Bonus\t'
if orientation==3:
strOut += effetDict[repereTableau][0] + ' Malus\t' + effetDict[repereTableau][1] + ' Malus\t'
strOut += str(repereTableau)
print strOut
print '\n'