]> SALOME platform Git repositories - tools/eficas.git/blobdiff - InterfaceQT4/readercata.py
Salome HOME
modif du 1010
[tools/eficas.git] / InterfaceQT4 / readercata.py
index 70783a5852c5404db88493b8c26789f761519643..b6e9957d3163a0557dc88fef13a38ba56d93a529 100644 (file)
@@ -65,7 +65,14 @@ class READERCATA:
       self.fic_cata=None
       self.OpenCata()
       self.cataitem=None
-      if self.code=="TELEMAC": self.cree_dico_inverse()
+      self.cree_dico_inverse()
+      if self.code=="TELEMAC": self.cree_dico_CasToCata()
+      #for k in self.dicoInverse.keys():
+      #   genea= self.dicoInverse[k]
+      #   for t in genea :
+      #       print t[0]
+      #   print "\n"
+
 
    def OpenCata(self):
       """ 
@@ -222,13 +229,13 @@ class READERCATA:
          self.appliEficas.rep_scripts=os.path.join(rep_cata,nom_cata)
          sys.path[:0] = [self.appliEficas.rep_scripts]
          try :
-             self.appliEficas.mesScripts=__import__(mesScriptsNomFichier)
+             self.appliEficas.mesScripts[self.code]=__import__(mesScriptsNomFichier)
          except:
              pass
          sys.path=sys.path[1:]
       else :
          try :
-            self.appliEficas.mesScripts=__import__(mesScriptsNomFichier)
+            self.appliEficas.mesScripts[self.code]=__import__(mesScriptsNomFichier)
          except:
             pass
 
@@ -317,29 +324,28 @@ class READERCATA:
         self.dicoMC={} 
         listeEtapes=self.cata[0].JdC.commandes
         for e in self.cata[0].JdC.commandes:
-        #for e in (self.cata[0].JdC.commandes[0],):
-            #print e.nom
             self.traite_entite(e)
-        #for e in self.cata[0].JdC.commandes:
-        #    self.cree_rubrique(e,self.dico,0)
-        #print self.dicoInverse
-
-        from Extensions import localisation
-        app=QApplication
-        # tres dommage  A Revoir
-        localisation.localise(app,"fr")
-        self.dicoInverseFrancais={}
-        self.dicoFrancaisAnglais={}
-        self.dicoAnglaisFrancais={}
-        for k in self.dicoInverse.keys():
-            listefr=[]
-            for nom, obj in self.dicoInverse[k] :
-                listefr.append((tr(nom),obj))
-                self.dicoFrancaisAnglais[tr(nom)]=nom
-                self.dicoAnglaisFrancais[nom]=tr(nom)
-            self.dicoInverseFrancais[tr(k)]=listefr
-            #print tr(k),listefr
-        if self.appliEficas.langue=="ang" : localisation.localise(app,"en")
+
+        #self.dicoFrancaisAnglais={}
+        #self.dicoAnglaisFrancais={}
+        #for k in self.dicoInverse.keys():
+        #    listefr=[]
+        #    for nom, obj in self.dicoInverse[k] :
+        #        listefr.append((tr(nom),obj))
+        #        self.dicoFrancaisAnglais[tr(nom)]=nom
+        #        self.dicoAnglaisFrancais[nom]=tr(nom)
+        #    self.dicoInverseFrancais[tr(k)]=listefr
+        #    #print tr(k),listefr
+
+   
+   def cree_dico_CasToCata(self):
+        if self.appliEficas.langue=="ang" :
+           from dicoCasEnToCata import DicoCasEnToCata as dicoCasToCata
+        else :
+           from dicoCasFrToCata import DicoCasFrToCata as dicoCasToCata
+        self.dicoCasToCata=dicoCasToCata
+        
+        
          
         
    def traite_entite(self,e):
@@ -359,6 +365,7 @@ class READERCATA:
                 moi=moi.pere
           liste.append((moi.nom,moi))
           self.dicoInverse[e.nom]=liste
+          self.dicoInverse[tr(e.nom)]=liste
 
    def cree_rubrique(self,e,dico, niveau):
        from Accas import A_BLOC