X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FTools%2FYamsPlug%2FmonViewText.py;h=ddc21501e8f6e5c74ed1a3aad7c031b9c9b4a02b;hb=84cf6c491178cc4cea1be9c8b2ba4d13750d02a3;hp=c1e90255b6e7a8bd3704d0acc589401956a25875;hpb=d8428a892b5d761ab7f62890b7a27b7e2e98f8fb;p=modules%2Fsmesh.git diff --git a/src/Tools/YamsPlug/monViewText.py b/src/Tools/YamsPlug/monViewText.py index c1e90255b..ddc21501e 100644 --- a/src/Tools/YamsPlug/monViewText.py +++ b/src/Tools/YamsPlug/monViewText.py @@ -35,8 +35,8 @@ verbose = True force = os.getenv("FORCE_DISTENE_LICENSE_FILE") if force != None: - os.environ["DISTENE_LICENSE_FILE"] = force - os.environ["DLIM8VAR"] = "NOTHING" + os.environ["DISTENE_LICENSE_FILE"] = force + os.environ["DLIM8VAR"] = "NOTHING" class MonViewText(Ui_ViewExe, QDialog): """ @@ -54,7 +54,7 @@ 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": @@ -73,14 +73,14 @@ class MonViewText(Ui_ViewExe, QDialog): cmds += 'echo %s\n' % txt #to see what is compute command cmds += txt+'\n' cmds += 'echo "END_OF_MGSurfOpt"\n' - + nomFichier = os.path.splitext(self.parent().fichierOut)[0] + ext with open(nomFichier, 'w') as f: - f.write(cmds) + f.write(cmds) self.make_executable(nomFichier) - + if verbose: print("INFO: MGSurfOpt launch script file: %s" % nomFichier) - + self.monExe.start(nomFichier) self.monExe.closeWriteChannel() self.enregistreResultatsDone=False @@ -98,12 +98,12 @@ class MonViewText(Ui_ViewExe, QDialog): if fn.isNull() : return ulfile = os.path.abspath(unicode(fn)) try: - f = open(fn, 'wb') - f.write(str(self.TB_Exe.toPlainText())) - f.close() + f = open(fn, 'wb') + f.write(str(self.TB_Exe.toPlainText())) + f.close() except IOError, why: - QMessageBox.critical(self, 'Save File', - 'The file %1 could not be saved.
Reason: %2'%(unicode(fn), str(why))) + QMessageBox.critical(self, 'Save File', + 'The file %1 could not be saved.
Reason: %2'%(unicode(fn), str(why))) def readFromStdErr(self): a=self.monExe.readAllStandardError() @@ -112,14 +112,14 @@ class MonViewText(Ui_ViewExe, QDialog): def readFromStdOut(self) : a=self.monExe.readAllStandardOutput() aa=unicode(a.data()) - self.TB_Exe.append(aa) - + self.TB_Exe.append(aa) + def finished(self): self.parent().enregistreResultat() self.enregistreResultatsDone=True - + def theClose(self): - if not self.enregistreResultatsDone: - self.parent().enregistreResultat() - self.enregistreResultatsDone=True - self.close() + if not self.enregistreResultatsDone: + self.parent().enregistreResultat() + self.enregistreResultatsDone=True + self.close()