Salome HOME
Horrible hack to allow a correct load of a Telemac case file when done after pre/V8_3_BR Salome_8_3_Hydro_2_0rc1
authorPaul RASCLE <paul.rascle@edf.fr>
Fri, 28 Jul 2017 11:21:49 +0000 (13:21 +0200)
committerPaul RASCLE <paul.rascle@edf.fr>
Fri, 28 Jul 2017 11:21:49 +0000 (13:21 +0200)
some other edition, such as create case for Pytel execution.

src/salome_hydro/telemac2d/eficas/appli.py

index 834af0065b4d93ecd9785fa2be6c7f3ae68b738c..69b982f8b697fbccd6504bda7861d06bb918cf0a 100644 (file)
@@ -37,6 +37,18 @@ import eficasSalome
 
 from salome.hydro.study import HydroStudyEditor
 
+def importFirst():
+    """
+    Horrible hack to allow a correct load of a Telemac case file when done after
+    some other edition, such as create case for Pytel execution.
+    """
+    eficasTelemacPath = os.path.join(eficasSalome.eficasConfig.eficasPath,'Telemac')
+    sys.path.insert(0, eficasTelemacPath)
+    from enum_Telemac2d_auto import TelemacdicoEn
+    sys.path.pop(0)
+
+importFirst()
+
 class EficasForTelemac2DAppli(eficasSalome.MyEficas):
     """
     This class launches Eficas and adds entries for the created files in