X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDLoader%2FSwig%2Fmedutilities.py;h=64c541868e1b1caf483606636390ea181d97a867;hb=b6c89e5886e9b348c00d3d6c23a265f89613cbc7;hp=adf51ce0bdc506dae21fc69912b5301249d2c17b;hpb=f2329e852caac14f317fd400894847b50af74127;p=tools%2Fmedcoupling.git diff --git a/src/MEDLoader/Swig/medutilities.py b/src/MEDLoader/Swig/medutilities.py index adf51ce0b..64c541868 100644 --- a/src/MEDLoader/Swig/medutilities.py +++ b/src/MEDLoader/Swig/medutilities.py @@ -1,11 +1,11 @@ # -*- coding: iso-8859-1 -*- # -- -# Copyright (C) 2009-2013 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2009-2015 CEA/DEN, EDF R&D # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either -# version 2.1 of the License. +# version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -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"]: