X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDLoader%2FSwig%2Fmedutilities.py;h=c9af7dbb083946d5040647c4fec2f301bda91029;hb=236b5af70ef21aef7eaea0c68d9453b263302fdf;hp=adf51ce0bdc506dae21fc69912b5301249d2c17b;hpb=f2329e852caac14f317fd400894847b50af74127;p=tools%2Fmedcoupling.git diff --git a/src/MEDLoader/Swig/medutilities.py b/src/MEDLoader/Swig/medutilities.py index adf51ce0b..c9af7dbb0 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-2020 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,9 +23,17 @@ 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 + print(file_in) # if file_out is None: file_out = file_in @@ -37,7 +45,7 @@ def convert(file_in, driver_in, driver_out, format=1, file_out=None): msg = "Driver out %s is unknown"%(driver_out) raise NotImplementedError(msg) pass - print file_out + print(file_out) # if driver_in == "GIBI": sr = SauvReader.New(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"]: