Salome HOME
0023235: [CEA 1730] Patches for SMESH on Windows
[modules/smesh.git] / src / Tools / MGCleanerPlug / MGCleanerMonPlugDialog.py
index b7d02ec8ef1dbb52f84c2520b6b6973346bf3048..b51f9ebc64394eb74578b7da7c8237590f2b7d83 100644 (file)
@@ -1,10 +1,10 @@
 # -*- coding: utf-8 -*-
-# Copyright (C) 2007-2013  EDF R&D
+# Copyright (C) 2013-2016  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
@@ -22,6 +22,7 @@
 # Modules Eficas
 
 import os, subprocess
+import tempfile
 from MGCleanerPlugDialog_ui import Ui_MGCleanerPlugDialog
 from MGCleanerMonViewText import MGCleanerMonViewText
 from PyQt4.QtGui import *
@@ -67,7 +68,7 @@ class MGCleanerMonPlugDialog(Ui_MGCleanerPlugDialog,QWidget):
     self.PB_MeshFile.setIcon(icon)
     self.PB_MeshFile.setToolTip("source mesh from a file in disk")
     
-    #Ces parametres ne sont pas remis à rien par le clean
+    #Ces parametres ne sont pas remis ?? rien par le clean
     self.paramsFile= os.path.abspath(os.path.join(os.environ["HOME"],".MGCleaner.dat"))
     self.LE_ParamsFile.setText(self.paramsFile)
     self.LE_MeshFile.setText("")
@@ -470,7 +471,9 @@ class MGCleanerMonPlugDialog(Ui_MGCleanerPlugDialog,QWidget):
     self.fichierIn=""
 
   def prepareFichier(self):
-    self.fichierIn="/tmp/ForMGCleaner_"+str(self.num)+".mesh"
+    self.fichierIn=tempfile.mktemp(suffix=".mesh",prefix="ForMGCleaner_")
+    if os.path.exists(self.fichierIn):
+        os.remove(self.fichierIn)
     self.__selectedMesh.ExportGMF(self.__selectedMesh, self.fichierIn, True)
 
   def PrepareLigneCommande(self):