2 from PyQt4.QtGui import *
3 from PyQt4.QtCore import *
7 def traduction(directPath,editor,version):
9 from Traducteur import traduitV7V8
11 if version == "V8V9" :
12 from Traducteur import traduitV8V9
14 fn = QFileDialog.getOpenFileName(
16 editor.appliEficas.trUtf8('Traduire Fichier'),
18 editor.appliEficas.trUtf8('JDC Files (*.comm);;''All Files (*)'))
20 FichieraTraduire=str(fn)
21 if (FichieraTraduire == "" or FichieraTraduire == () ) : return
22 i=FichieraTraduire.rfind(".")
23 Feuille=FichieraTraduire[0:i]
24 FichierTraduit=Feuille+suffixe
27 directLog=Feuille[0:i]
28 log=directLog+"/convert.log"
29 os.system("rm -rf "+log)
30 os.system("rm -rf "+FichierTraduit)
31 print "hhhhhhhhhhhhhhhhhhhhhhhhhhhh"
33 qApp.setOverrideCursor(QCursor(Qt.WaitCursor))
34 if version == "V7V8" : traduitV7V8.traduc(FichieraTraduire,FichierTraduit,log)
35 if version == "V8V9" : traduitV8V9.traduc(FichieraTraduire,FichierTraduit,log)
36 qApp.setOverrideCursor(QCursor(Qt.ArrowCursor))
38 Entete="Fichier Traduit : "+FichierTraduit +"\n\n"
39 if os.stat(log)[6] != 0L :
45 commande="diff "+FichieraTraduire+" "+FichierTraduit+" >/dev/null"
47 if os.system(commande) == 0 :
48 texte = texte + "Pas de difference entre le fichier origine et le fichier traduit"
52 from monVisu import DVisu
53 titre = "conversion de "+ FichieraTraduire
54 monVisuDialg=DVisu(parent=editor.appliEficas,fl=0)
55 monVisuDialg.setWindowTitle(titre)
56 monVisuDialg.TB.setText(texte)