From 9ed7d5c91cdddb3daf3c36c1c4ab09d3df18a8f5 Mon Sep 17 00:00:00 2001 From: ageay Date: Thu, 4 Apr 2013 15:20:12 +0000 Subject: [PATCH] MEDMEM suppression --- src/MEDLoader/Swig/CMakeLists.txt | 3 ++- src/MEDLoader/Swig/Makefile.am | 4 ++-- src/MEDLoader/Swig/med2sauv | 1 + src/MEDLoader/Swig/medutilities.py | 10 ++++++++++ src/MEDLoader/Swig/sauv2med | 1 + 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/MEDLoader/Swig/CMakeLists.txt b/src/MEDLoader/Swig/CMakeLists.txt index ebdd64576..98919949d 100644 --- a/src/MEDLoader/Swig/CMakeLists.txt +++ b/src/MEDLoader/Swig/CMakeLists.txt @@ -63,7 +63,8 @@ INSTALL(FILES MEDLoader.i MEDLoaderTypemaps.i MEDLoaderCommon.i DESTINATION ${ME SET(PYFILES_TO_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/MEDLoader.py ${CMAKE_CURRENT_SOURCE_DIR}/libMEDLoader_Swig.py) INSTALL_AND_COMPILE_PYTHON_FILE("${PYFILES_TO_INSTALL}" ${MED_salomescript_PYTHON}) -INSTALL(FILES MEDLoaderDataForTest.py MEDLoaderTest.py MEDLoaderTest2.py MEDLoaderTest3.py DESTINATION ${MED_salomescript_PYTHON}) +INSTALL(FILES MEDLoaderDataForTest.py MEDLoaderTest.py MEDLoaderTest2.py MEDLoaderTest3.py medutilities.py DESTINATION ${MED_salomescript_PYTHON}) +INSTALL(FILES med2sauv sauv2med PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ DESTINATION ${MED_salomescript_PYTHON} ) ADD_TEST(MEDLoaderTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDLoaderTest.py) ADD_TEST(MEDLoaderTest2 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDLoaderTest2.py) diff --git a/src/MEDLoader/Swig/Makefile.am b/src/MEDLoader/Swig/Makefile.am index 24778a285..a1a8fd359 100644 --- a/src/MEDLoader/Swig/Makefile.am +++ b/src/MEDLoader/Swig/Makefile.am @@ -53,7 +53,7 @@ _MEDLoader_la_LDFLAGS = -module $(MED3_LIBS_C_ONLY) $(HDF5_LIBS) $(PYTHON_LIBS) CLEANFILES = MEDLoader_wrap.cxx MEDLoader.py -dist_salomescript_DATA= MEDLoaderDataForTest.py MEDLoaderTest.py MEDLoaderTest2.py MEDLoaderTest3.py libMEDLoader_Swig.py +dist_salomescript_DATA= MEDLoaderDataForTest.py MEDLoaderTest.py MEDLoaderTest2.py MEDLoaderTest3.py libMEDLoader_Swig.py med2sauv sauv2med medutilities.py nodist_salomescript_DATA = MEDLoader.py -UNIT_TEST_PROG = MEDLoaderTest.py MEDLoaderTest2.py \ No newline at end of file +UNIT_TEST_PROG = MEDLoaderTest.py MEDLoaderTest2.py diff --git a/src/MEDLoader/Swig/med2sauv b/src/MEDLoader/Swig/med2sauv index 943ce34ca..511e19d51 100755 --- a/src/MEDLoader/Swig/med2sauv +++ b/src/MEDLoader/Swig/med2sauv @@ -23,6 +23,7 @@ from sys import argv,path from os.path import dirname,abspath,sep +from medutilities import med2sauv d = argv[0] d = dirname(d) diff --git a/src/MEDLoader/Swig/medutilities.py b/src/MEDLoader/Swig/medutilities.py index adf51ce0b..c53c98524 100644 --- a/src/MEDLoader/Swig/medutilities.py +++ b/src/MEDLoader/Swig/medutilities.py @@ -23,6 +23,14 @@ from MEDLoader import * +def my_remove(f): + from os import remove + try: + remove(f) + except OSError: + pass + return + def convert(file_in, driver_in, driver_out, format=1, file_out=None): # print file_in @@ -56,6 +64,8 @@ def convert(file_in, driver_in, driver_out, format=1, file_out=None): sw.setMEDFileDS(mfd,0);#0 ? sw.write(file_out) # + mesh = mfd.getMeshes()[0] + mesh_dim = mesh.getSpaceDimension() if mesh_dim >= 3: from sys import platform if platform in ["win32"]: diff --git a/src/MEDLoader/Swig/sauv2med b/src/MEDLoader/Swig/sauv2med index 2b0760e19..9673ff69c 100755 --- a/src/MEDLoader/Swig/sauv2med +++ b/src/MEDLoader/Swig/sauv2med @@ -23,6 +23,7 @@ from sys import argv,path from os.path import dirname,abspath,sep +from medutilities import sauv2med d = argv[0] d = dirname(d) -- 2.39.2