Salome HOME
Horrible hack to allow a correct load of a Telemac case file when done after
[modules/hydrosolver.git] / 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