mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-13 10:10:33 +05:00
0023235: [CEA 1730] Patches for SMESH on Windows
This commit is contained in:
parent
1a88a8f665
commit
c445ce74d8
@ -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 *
|
||||
@ -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):
|
||||
|
@ -19,7 +19,8 @@
|
||||
#
|
||||
|
||||
# Modules Python
|
||||
import string,types,os
|
||||
import string,types,os,sys
|
||||
import tempfile
|
||||
import traceback
|
||||
|
||||
from PyQt4 import *
|
||||
@ -51,16 +52,39 @@ class MGCleanerMonViewText(Ui_ViewExe, QDialog):
|
||||
# Je n arrive pas a utiliser le setEnvironment du QProcess
|
||||
# fonctionne hors Salome mais pas dans Salome ???
|
||||
cmds=''
|
||||
'''
|
||||
try :
|
||||
LICENCE_FILE=os.environ["DISTENE_LICENCE_FILE_FOR_MGCLEANER"]
|
||||
except:
|
||||
LICENCE_FILE=''
|
||||
try :
|
||||
PATH=os.environ["DISTENE_PATH_FOR_MGCLEANER"]
|
||||
except:
|
||||
PATH=''
|
||||
if LICENCE_FILE != '':
|
||||
cmds+='source '+LICENCE_FILE+'\n'
|
||||
else:
|
||||
cmds+="# $DISTENE_LICENCE_FILE_FOR_MGCLEANER NOT SET\n"
|
||||
if PATH != '':
|
||||
cmds+='export PATH='+PATH+':$PATH\n'
|
||||
else:
|
||||
cmds+="# $DISTENE_PATH_FOR_MGCLEANER NOT SET\n"
|
||||
#cmds+='env\n'
|
||||
cmds+='rm -f '+self.parent().fichierOut+'\n'
|
||||
'''
|
||||
cmds+=txt+'\n'
|
||||
cmds+='echo END_OF_MGCleaner\n'
|
||||
pid=self.monExe.pid()
|
||||
nomFichier='/tmp/MGCleaner_'+str(pid)+'.sh'
|
||||
ext=''
|
||||
if sys.platform == "win32":
|
||||
ext = '.bat'
|
||||
else:
|
||||
ext = '.sh'
|
||||
nomFichier=tempfile.mktemp(suffix=ext,prefix="MGCleaner_")
|
||||
f=open(nomFichier,'w')
|
||||
f.write(cmds)
|
||||
f.close()
|
||||
|
||||
maBidouille='sh ' + nomFichier
|
||||
maBidouille=nomFichier
|
||||
self.monExe.start(maBidouille)
|
||||
self.monExe.closeWriteChannel()
|
||||
self.enregistreResultatsDone=False
|
||||
|
@ -19,8 +19,9 @@
|
||||
#
|
||||
|
||||
# Modules Python
|
||||
import string,types,os
|
||||
import string,types,os, sys
|
||||
import traceback
|
||||
import tempfile
|
||||
|
||||
from PyQt4 import *
|
||||
from PyQt4.QtGui import *
|
||||
@ -49,16 +50,25 @@ class MonViewText(Ui_ViewExe, QDialog):
|
||||
# Je n arrive pas a utiliser le setEnvironment du QProcess
|
||||
# fonctionne hors Salome mais pas dans Salome ???
|
||||
cmds=''
|
||||
cmds+='rm -f '+self.parent().fichierOut+'\n'
|
||||
#cmds+='#! /usr/bin/env python\n'
|
||||
#cmds+='# -*- coding: utf-8 -*-\n'
|
||||
cmds+=txt+'\n'
|
||||
cmds+='echo END_OF_Yams\n'
|
||||
pid=self.monExe.pid()
|
||||
nomFichier='/tmp/Yams_'+str(pid)+'.sh'
|
||||
cmds+='echo "END_OF_Yams"\n'
|
||||
if os.path.exists(self.parent().fichierOut):
|
||||
os.remove(self.parent().fichierOut)
|
||||
|
||||
ext=''
|
||||
if sys.platform == "win32":
|
||||
ext = '.bat'
|
||||
else:
|
||||
ext = '.sh'
|
||||
|
||||
nomFichier=tempfile.mktemp(suffix=ext,prefix='Yams_')
|
||||
f=open(nomFichier,'w')
|
||||
f.write(cmds)
|
||||
f.close()
|
||||
|
||||
maBidouille='sh ' + nomFichier
|
||||
maBidouille=nomFichier
|
||||
self.monExe.start(maBidouille)
|
||||
self.monExe.closeWriteChannel()
|
||||
self.enregistreResultatsDone=False
|
||||
|
@ -22,6 +22,7 @@
|
||||
# Modules Eficas
|
||||
|
||||
import os, subprocess
|
||||
import tempfile
|
||||
from YamsPlugDialog_ui import Ui_YamsPlugDialog
|
||||
from monViewText import MonViewText
|
||||
from PyQt4.QtGui import *
|
||||
@ -430,7 +431,9 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
|
||||
self.fichierIn=""
|
||||
|
||||
def prepareFichier(self):
|
||||
self.fichierIn="/tmp/ForSurfOpt_"+str(self.num)+".meshb"
|
||||
self.fichierIn=tempfile.mktemp(suffix=".meshb",prefix="ForSurfOpt_")
|
||||
if os.path.exists(self.fichierIn):
|
||||
os.remove(self.fichierIn)
|
||||
self.__selectedMesh.ExportGMF(self.__selectedMesh, self.fichierIn, True)
|
||||
|
||||
def PrepareLigneCommande(self):
|
||||
|
Loading…
Reference in New Issue
Block a user