from MEDLoader import MEDFileMesh
# TODO: get rid of sys.path.append() ?
-hydro_solver_root = os.path.join(os.environ['HYDROSOLVER_ROOT_DIR'], 'lib', 'python2.7', 'site-packages', 'salome')
-#sys.path.append(os.path.join(hydro_solver_root, 'salome', 'hydrotools'))
+import sysconfig
+pythonVersion = 'python' + sysconfig.get_python_version()
+hydro_solver_root = os.path.join(os.environ['HYDROSOLVER_ROOT_DIR'], 'lib', pythonVersion, 'site-packages', 'salome')
from salome.hydro import boundaryConditions
"""Initialize presets"""
def init_presets(self):
# TODO: determine another presets path
- presets_data_root = os.path.join(os.environ['HYDROSOLVER_ROOT_DIR'], 'lib', 'python2.7', 'site-packages', 'salome', 'tests', 'data')
+ presets_data_root = os.path.join(os.environ['HYDROSOLVER_ROOT_DIR'], 'lib', pythonVersion, 'site-packages', 'salome', 'tests', 'data')
file_path = os.path.join(presets_data_root, 'bnd_conditions_presets.txt')
reader = boundaryConditions.PresetReader(file_path)
self.presets = reader.read()
import sys, os
import string
-#hydro_solver_root = os.path.join(os.environ['HYDROSOLVER_ROOT_DIR'], 'lib', 'python2.7', 'site-packages', 'salome', 'salome', 'hydro')
+#import sysconfig
+#pythonVersion = 'python' + sysconfig.get_python_version()
+#hydro_solver_root = os.path.join(os.environ['HYDROSOLVER_ROOT_DIR'], 'lib', pythonVersion, 'site-packages', 'salome')
#import salome
#salome.salome_init()
import sys, os
import string
-#hydro_solver_root = os.path.join(os.environ['HYDROSOLVER_ROOT_DIR'], 'lib', 'python2.7', 'site-packages', 'salome', 'salome', 'hydro')
+#import sysconfig
+#pythonVersion = 'python' + sysconfig.get_python_version()
+#hydro_solver_root = os.path.join(os.environ['HYDROSOLVER_ROOT_DIR'], 'lib', pythonVersion, 'site-packages', 'salome')
#import salome
#salome.salome_init()
import sys, os
import string
-#hydro_solver_root = os.path.join(os.environ['HYDROSOLVER_ROOT_DIR'], 'lib', 'python2.7', 'site-packages', 'salome', 'salome', 'hydro')
+#import sysconfig
+#pythonVersion = 'python' + sysconfig.get_python_version()
+#hydro_solver_root = os.path.join(os.environ['HYDROSOLVER_ROOT_DIR'], 'lib', pythonVersion, 'site-packages', 'salome')
#import salome
#salome.salome_init()
import sys, os
import string
-hydro_solver_root = os.path.join(os.environ['HYDROSOLVER_ROOT_DIR'], 'lib', 'python2.7', 'site-packages', 'salome', 'salome', 'hydro')
+import sysconfig
+pythonVersion = 'python' + sysconfig.get_python_version()
+hydro_solver_root = os.path.join(os.environ['HYDROSOLVER_ROOT_DIR'], 'lib', pythonVersion, 'site-packages', 'salome', 'salome', 'hydro')
import salome
salome.salome_init()
import os
-hydro_solver_root = os.path.join(os.environ['HYDROSOLVER_ROOT_DIR'], 'lib', 'python2.7', 'site-packages', 'salome', 'salome', 'hydro')
+import sysconfig
+pythonVersion = 'python' + sysconfig.get_python_version()
+hydro_solver_root = os.path.join(os.environ['HYDROSOLVER_ROOT_DIR'], 'lib', pythonVersion, 'site-packages', 'salome', 'salome', 'hydro')
def replace( lines, pattern, subst ):
for i in range( 0, len( lines ) ):
import sys, os
import string
-#sys.path.append(os.path.join(os.environ['MEDFILE_ROOT_DIR'], 'lib/python2.7/site-packages/med'))
-#sys.path.append(os.path.join(os.environ['MEDFICHIER_INSTALL_DIR'], 'lib/python2.7/site-packages/med'))
-hydro_solver_root = os.path.join(os.environ['HYDROSOLVER_ROOT_DIR'], 'lib', 'python2.7', 'site-packages', 'salome', 'salome', 'hydro')
-#sys.path.append(hydro_solver_root)
+import sysconfig
+pythonVersion = 'python' + sysconfig.get_python_version()
+hydro_solver_root = os.path.join(os.environ['HYDROSOLVER_ROOT_DIR'], 'lib', pythonVersion, 'site-packages', 'salome', 'salome', 'hydro')
import salome
salome.salome_init()
cur_dir = os.path.dirname(os.path.realpath(__file__))
data_dir = os.path.join(cur_dir, "data")
-#hydro_solver_root = os.path.join(os.environ['HYDROSOLVER_ROOT_DIR'], 'lib', 'python2.7', 'site-packages', 'salome')
-#sys.path.append(hydro_solver_root)
+#import sysconfig
+#pythonVersion = 'python' + sysconfig.get_python_version()
+#hydro_solver_root = os.path.join(os.environ['HYDROSOLVER_ROOT_DIR'], 'lib', pythonVersion, 'site-packages', 'salome', 'salome', 'hydro')
from BndConditionsDialog import BoundaryConditionsDialog
# Show the dialog
cur_dir = os.path.dirname(os.path.realpath(__file__))
data_dir = os.path.join(cur_dir, "data")
-#hydro_solver_root = os.path.join(os.environ['HYDROSOLVER_ROOT_DIR'], 'lib', 'python2.7', 'site-packages', 'salome')
-#sys.path.append(hydro_solver_root)
+#import sysconfig
+#pythonVersion = 'python' + sysconfig.get_python_version()
+#hydro_solver_root = os.path.join(os.environ['HYDROSOLVER_ROOT_DIR'], 'lib', pythonVersion, 'site-packages', 'salome', 'salome', 'hydro')
import boundaryConditions