- self.connect(self.monExe, SIGNAL("readyReadStandardOutput()"), self.readFromStdOut )
- self.connect(self.monExe, SIGNAL("readyReadStandardError()"), self.readFromStdErr )
-
- # 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'
- 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=nomFichier
- self.monExe.start(maBidouille)
+ self.monExe.readyReadStandardOutput.connect( self.readFromStdOut )
+ self.monExe.readyReadStandardError.connect( self.readFromStdErr )
+ self.monExe.finished.connect( self.finished )
+ self.monExe.errorOccurred.connect( self.errorOccured )
+
+ if os.path.exists(self.parent().fichierOut):
+ os.remove(self.parent().fichierOut)
+
+ self.monExe.start(txt)