# -*- 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
#
# Modules Python
-import string,types,os
+import string,types,os,sys
+import tempfile
import traceback
from PyQt4 import *
# Import des panels
-from MGCleanerViewText import Ui_ViewExe
+from MGCleanerViewText_ui import Ui_ViewExe
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:
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