Salome HOME
0023473: [CEA 2163] SMESH compilation failure with a PyCompileError
[modules/smesh.git] / src / Tools / YamsPlug / monViewText.py
index 426467ef4351d3380656ef528ee70de52fc34016..c1e90255b6e7a8bd3704d0acc589401956a25875 100644 (file)
@@ -53,11 +53,14 @@ class MonViewText(Ui_ViewExe, QDialog):
 
         self.monExe.readyReadStandardOutput.connect( self.readFromStdOut )
         self.monExe.readyReadStandardError.connect( self.readFromStdErr )
+        self.monExe.finished.connect( self.finished )
       
         cmds = ''
         ext = ''
         if sys.platform == "win32":
-            cmds += 'delete %s\n' % self.parent().fichierOut
+            if os.path.exists(self.parent().fichierOut):
+                cmds += 'del %s\n' % self.parent().fichierOut
+            ext = '.bat'
         else:
             cmds += '#!/bin/bash\n'
             cmds += 'pwd\n'
@@ -108,12 +111,12 @@ class MonViewText(Ui_ViewExe, QDialog):
 
     def readFromStdOut(self) :
         a=self.monExe.readAllStandardOutput()
-        aa=unicode(a.data(),len(a))
-        self.TB_Exe.append(aa)
-        if "END_OF_MGSurfOpt" in aa:
-          self.parent().enregistreResultat()
-          self.enregistreResultatsDone=True
-          #self.theClose()
+        aa=unicode(a.data())
+        self.TB_Exe.append(aa)    
+    
+    def finished(self):
+        self.parent().enregistreResultat()
+        self.enregistreResultatsDone=True
     
     def theClose(self):
       if not self.enregistreResultatsDone: