Salome HOME
22612: [CEA 1189] sauv2med should not change faces orientation
[tools/medcoupling.git] / src / MEDLoader / Swig / medutilities.py
index adf51ce0bdc506dae21fc69912b5301249d2c17b..98c06bf197e2fe72ea094655ddf88ec84fa70ed8 100644 (file)
@@ -1,11 +1,11 @@
 # -*- coding: iso-8859-1 -*-
 # --
-# Copyright (C) 2009-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2009-2014  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
 
 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"]: