from PyQt5.QtWidgets import QWidget, QMessageBox, QFileDialog, QApplication, QSplitter, QLabel
from PyQt5.QtGui import QPalette
-from PyQt5.QtCore import QProcess, QFileInfo, QTimer, Qt, QDir, QSize
+from PyQt5.QtCore import QProcess, QFileInfo, QTimer, Qt, QDir, QSize, QProcessEnvironment
import traceback
noeudAvantCommentaire.addComment(True)
- #----------------------------------------------------------------------------#
- def _viewTextExecute(self, txt, prefix, suffix, fichierExe=None, shell='sh'):
- #---------------------------------------------------------------------------#
+ #-----------------------------------------------------------------------------------------------#
+ def _viewTextExecute(self, txt, prefix, suffix, fichierExe=None, shell='sh', texteCommande=None):
+ #----------------------------------------------------------------------------------------------#
self.w = ViewText( self.QWParent )
self.w.setWindowTitle( "execution" )
self.monExe=QProcess(self.w)
pid=self.monExe.pid()
- if not fichierExe :
+ if not fichierExe and txt :
fichierExe = self.generateTempFilename(prefix, suffix = ".sh")
f=open(fichierExe,'w')
f.write(txt)
f.close()
self.monExe.readyReadStandardOutput.connect( self.readFromStdOut)
self.monExe.readyReadStandardError.connect( self.readFromStdErr)
- exe=shell + ' ' + fichierExe
+ if texteCommande != None : exe=texteCommande
+ else : exe=shell + ' ' + fichierExe
+ print (exe)
+ monEnv=QProcessEnvironment.systemEnvironment()
+ monEnv.insert('COLUMNS','500')
+ self.monExe.setProcessEnvironment(monEnv)
+
self.monExe.start(exe)
self.monExe.closeWriteChannel()
self.w.exec_()
#if self.modified or not self.fichier :
sauvegarde, fichier= self.saveUQFile()
if not sauvegarde : return 0
+ #texteCommande=' export COLUMNS=200;'
+ texteCommande =' /home/A96028/salome/appli_V9_7_0_sysVersion/salome start -k -t python3 ' + self.generator.fichierUQExe
#self._viewTextExecute(None,None,None, fichierExe=self.generator.fichierUQExe, shell='python3')
#self._viewTextExecute('ls -l /tmp','essaiLs','.sh',)
- self._viewTextExecute(None,None,None, fichierExe='/home/A96028/QT5Dev/eficasRN/ReacteurNumerique/a.py',shell='python3',)
+ #self._viewTextExecute(None,None,None, fichierExe='/home/A96028/QT5Dev/eficasRN/ReacteurNumerique/a.py',shell='python3',)
+ self._viewTextExecute(None,None,None, texteCommande=texteCommande)
return True
#----------------------------------------------#
JobName = SIMP ( statut = 'o', typ ="TXM", defaut='idefix_rn_job'),
ResourceName = SIMP ( statut = 'o', typ ="TXM", defaut ='localhost'),
Login = SIMP ( statut = 'o', typ ="TXM", defaut = os.getlogin() ),
-# WorkDirectory = SIMP ( statut = 'o', typ='Repertoire' , defaut='/tmp/C65845_workingdir_uncertainty'), #TODO: Login + NonExistent
- WorkDirectory = SIMP ( statut = 'o', typ='TXM' , defaut='/tmp/C65845_workingdir_uncertainty'), #TODO: Login + NonExistent
+# WorkDirectory = SIMP ( statut = 'o', typ='Repertoire' , defaut='/tmp/'+os.getlogin()+'_workingdir_uncertainty'), #TODO: Login + NonExistent
+ WorkDirectory = SIMP ( statut = 'o', typ='TXM' , defaut='/tmp/'+os.getlogin()+'_workingdir_uncertainty'), #TODO: NonExistent
# ResultDirectory = SIMP ( statut = 'o', typ='Repertoire' , defaut='/tmp/idefix_rn_job'), #TODO: JobName
ResultDirectory = SIMP ( statut = 'o', typ='TXM' , defaut='/tmp/idefix_rn_job'), #TODO: JobName
UncertaintyScript=SIMP( statut="o", typ=("FichierNoAbs", "All Files ()"), defaut=scriptDeLancement,
NbOfProcs = SIMP ( statut = 'o', typ ="I" , defaut = 1, val_min = 1, fr='Equivaut au nombre de tasks SLURM affectées à chaque job'),
JobName = SIMP ( statut = 'o', typ ="TXM", defaut='idefix_rn_job'),
ResourceName = SIMP ( statut = 'o', typ ="TXM", defaut ='gaia'),
- Login = SIMP( statut = 'o', typ ="TXM", defaut ='C65845'),
- WorkDirectory = SIMP ( statut = 'o', typ='TXM' , defaut='/scratch/C65845/workingdir/persalys_light'), #TODO: Login
-# WorkDirectory = SIMP ( statut = 'o', typ='Repertoire' , defaut='/scratch/C65845/workingdir/persalys_light'), #TODO: Login
+ Login = SIMP( statut = 'o', typ ="TXM", defaut = os.getlogin()),
+ WorkDirectory = SIMP ( statut = 'o', typ='TXM' , defaut='/scratch/'+os.getlogin()+'/workingdir/persalys_light'), #TODO: Login
+# WorkDirectory = SIMP ( statut = 'o', typ='Repertoire' , defaut='/scratch/'+os.getlogin()+'/workingdir/persalys_light'), #TODO: Login
ResultDirectory = SIMP ( statut = 'o', typ='TXM' , defaut='/tmp/idefix_rn_job'), #TODO: JobName
# ResultDirectory = SIMP ( statut = 'o', typ='Repertoire' , defaut='/tmp/idefix_rn_job'), #TODO: JobName
Consigne = SIMP(statut="o", homo="information", typ="TXM",
defaut="Le chemin d'accès au script de lancement est celui utilisé par les machines du cluster."),
- ScriptDeLancement=SIMP( statut="o", typ=("FichierNoAbs", "All Files ()"), defaut=scriptDeLancement,
+ UncertaintyScript = SIMP( statut="o", typ=("FichierNoAbs", "All Files ()"), defaut=scriptDeLancement,
fr="Nom du fichier script de lancement", ang="script File to launch",),
),
),
# print('txtResultCT:',txtResultCT)
optionalResultList=getStrVarList(optionalResultNames)
optionalResultStrList=getStrVarStrList(optionalResultNames)
+ post_csv_rnScript=os.path.basename(self.ScriptPosttraitement).split('.')[0]
+ post_csv_rnPath=os.path.dirname(self.ScriptPosttraitement)
+ print (post_csv_rnScript)
+ print (post_csv_rnPath)
txtPrintResult=printResult.format(
+ post_csv_rnScript = post_csv_rnScript,
+ post_csv_rnPath = post_csv_rnPath,
optionalResultList = optionalResultList,
optionalResultStrList = optionalResultStrList,
resultSkList = getStrVarList(self.resultSkList))
# outputs = [d]
printResult=""" import numpy as np
- from post_csv_rn import write_result_from_persalys
+ sys.path.append(os.path.abspath('{post_csv_rnPath}'))
+ from {post_csv_rnScript} import write_result_from_persalys
+
+ #from post_csv_rn import write_result_from_persalys
# import pandas as pnd
# from functools import reduce