diff --git a/cleanLocalHdd.py b/cleanLocalHdd.py index dfe60c6f2464c07de829a4c41167772b304c377a..8f09b5b8d55c2489043e5ac7206b2ea6d914237b 100755 --- a/cleanLocalHdd.py +++ b/cleanLocalHdd.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!python3 # -*- coding: utf-8 -*- # # Script cleanLocalHdd.py : listing de l'utilisation et nettoyage des disques locaux sur le cluster diff --git a/comp.py b/comp.py index becc12012ab1dbc0e8c2870a8fedc5d9e7dc17d9..5969effdaa4fd926e7c01da1ed7d95dbc242458d 100755 --- a/comp.py +++ b/comp.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!python3 # -*- coding: utf-8 -*- # # Script "comp.py": diff --git a/externalProgramPath.py b/externalProgramPath.py index 208b8c9da5ec57e52325102856dd0c67d3d29627..250cbaa8bc24bcd119e3b38ad52724ce9a3fa888 100755 --- a/externalProgramPath.py +++ b/externalProgramPath.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!python3 # -*- coding: utf-8 -*- # # Define external program paths according to local configuration diff --git a/externalProgramPathGui.pyw b/externalProgramPathGui.pyw index 989470f3c5ba9d84bc3b92416144802109ed4177..990ee5c749a2831d8fc558dcee11550edb60bf5d 100755 --- a/externalProgramPathGui.pyw +++ b/externalProgramPathGui.pyw @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!python3 # -*- coding: utf-8 -*- # # Gui to configure externals program path according to local configuration diff --git a/launch.py b/launch.py index 9a042f41048a7bfebe3aa20ed6526d25398fa9d2..3500dc610d84143530d52e6e463e414cc998835a 100755 --- a/launch.py +++ b/launch.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!python3 # -*- coding: utf-8 -*- # # Script "launch.py": aide au lancement d'un job Metafor @@ -344,19 +344,12 @@ class LaunchJob(ParametricJob): if self.debug: pin.write(b'print ("sys.path = ", sys.path)\n') pin.write(b'print ("os.getcwd() = ", os.getcwd())\n') - #pin.write("raw_input()\n") - print ("mtfdir = ", mtfdir) - print ("type mtfdir = ", type(mtfdir)) pin.write(('if os.path.isdir(r"%s"):\n'%mtfdir).encode('utf-8')) - #pin.write(('if os.path.isdir(r"%s"):\n'%mtfdir)) pin.write(('\tsys.path.append(r"%s")\n'%mtfdir).encode('utf-8')) # mtfdir est dorenavant un abspath - #pin.write(('\tsys.path.append(r"%s")\n'%mtfdir)) # mtfdir est dorenavant un abspath - #pin.write('\tsys.path.append(os.path.abspath(r"%s"))\n'%mtfdir) pin.write(b'else:\n') pin.write(('\tprint ("metafor dir %s not found!")\n'%mtfdir).encode('utf-8')) pin.write(b'\tsys.exit()\n\n') pin.write(('exec(open(r"%s").read())\n'%os.path.join(mtfdir,'.pythonrc.py')).encode('utf-8')) - #pin.write(('execfile(r"%s")\n'%os.path.join(mtfdir,'.pythonrc.py')).encode()) pin.write(b'import toolbox.battery as b\n') pin.write(b'battery = b.Battery() \n') pin.write(b'battery.keepFacs = True\n') @@ -390,7 +383,6 @@ class LaunchJob(ParametricJob): if self.pars['AFFINITY'].val != '': pin.write(('battery.setAffinity("%s")\n'%self.pars['AFFINITY'].val).encode('utf-8')) if self.pars['NICE_VALUE'].val != '0': - #print ('battery.setNice(%s)\n'%self.pars['NICE_VALUE'].val) pin.write(('battery.setNice(%s)\n'%self.pars['NICE_VALUE'].val).encode('utf-8')) pin.write(('battery.setNumTasks(%s)\n'%self.pars['NB_TASKS'].val).encode('utf-8')) diff --git a/launchGui.pyw b/launchGui.pyw index fe29410b2a0ddac459cdbd32da48b0b98dadab6d..4e15048370837a23d93ebf9fa2a36314715c1d50 100755 --- a/launchGui.pyw +++ b/launchGui.pyw @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!python3 # -*- coding: utf-8 -*- # # GUI de launch.py - version Qt @@ -242,8 +242,7 @@ class LaunchGui(QWidget): # ---------------------------------------------------------------------------------- def go(self): - print("Go pressed") - + print("Go pressed") # disable the gui modifications during run self.guiEnable(False) try: @@ -263,9 +262,7 @@ class LaunchGui(QWidget): if isUnix(): mtfdir, mtfexe = os.path.split(self.launch.pars['EXEC_NAME'].val) ldlp = mtfdir+':'+env.value('LD_LIBRARY_PATH','') - #print "old LD_LIBRARY_PATH = ", env.value('LD_LIBRARY_PATH','') env.insert('LD_LIBRARY_PATH',ldlp) - #print "new LD_LIBRARY_PATH = ", env.value('LD_LIBRARY_PATH','') self.process.setProcessEnvironment(env) # gestion du nice sur le QProcess : pas arrive a faire marcher !!! @@ -278,7 +275,6 @@ class LaunchGui(QWidget): self.launch.go() except Exception as e: - #print e QMessageBox.information(self, 'Error', str(e)) # re enable the gui modifications diff --git a/parametricJob.py b/parametricJob.py index 141018bbd8b6efe46982d933f26fbf0e9c449c9d..b5a81d51e585fe7117847faa6e72d5962a1b79a0 100644 --- a/parametricJob.py +++ b/parametricJob.py @@ -1,3 +1,4 @@ +#!python3 # -*- coding: utf-8 -*- from __future__ import print_function @@ -236,7 +237,7 @@ class ParametricJob(PRMSet): cmd1 = "rsync -avz %s/* %s"%(localNodeDir, homeDir) #--remove-source-files permet de nettoyer la source, mais ca risque de poser problème avec le check ci dessous # qui plus est, ne supprime pas l'arborescence, juste les fichiers => nettoyage incomplet - print("cmd1 = ", cmd1) + #print("cmd1 = ", cmd1) subprocess.call([cmd1],stderr=subprocess.STDOUT, shell=True) #use of subprocess to be able to catch errors #execfile(self.cpNodeResultsScriptName(jobId)) # check que la copie soit bonne (même fichiers des 2 cotés) @@ -246,7 +247,7 @@ class ParametricJob(PRMSet): if recCmp(cmp): # copie parfaite => nettoyage brutal de l'arborescence print("copie parfaite => nettoyage brutal de l'arborescence ") cmd2 = "rm -rf %s"%localNodeDir - print("cmd2 = ", cmd2) + #print("cmd2 = ", cmd2) subprocess.call([cmd2],stderr=subprocess.STDOUT, shell=True) # 2 commands for not deleting files if copy throw an exception os.remove(self.cpNodeResultsScriptName(jobId)) os.remove(self.rmNodeResultsScriptName(jobId)) diff --git a/postProLoop.py b/postProLoop.py index 5dc628cb99db305874034b8a4fc01050bf257ad2..df6bce6b73064e0fc92cc5486ec9b91f1e207068 100755 --- a/postProLoop.py +++ b/postProLoop.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!python3 # -*- coding: utf-8 -*- # $Id: externalProgramPath.py 2645 2016-05-12 06:29:38Z boman $ # diff --git a/postProLoopGui.pyw b/postProLoopGui.pyw index ef1b5d097eaae753581b4026ae20de24d11c7011..3de26518df5acc9b997ae250b2f4b61fa0707743 100755 --- a/postProLoopGui.pyw +++ b/postProLoopGui.pyw @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!python3 # -*- coding: utf-8 -*- # $Id: externalProgramPathGui.pyw 2384 2015-09-22 10:07:54Z papeleux $ # diff --git a/prmClasses.py b/prmClasses.py index a20a80138c6f504d7e58e32d34e6cdec4733f617..01e355ade4c39d35e0ccdb03736ee792a3d9e52c 100644 --- a/prmClasses.py +++ b/prmClasses.py @@ -1,3 +1,4 @@ +#!python3 # -*- coding: utf-8 -*- # # Classes de gestion des parametres diff --git a/prmClassesGui.py b/prmClassesGui.py index 847ed65973992ae3a822fd0cd860daa6bac54cd6..6c6b1117a3df9c8382b0a977f33def412da87895 100644 --- a/prmClassesGui.py +++ b/prmClassesGui.py @@ -1,3 +1,4 @@ +#!python3 # -*- coding: utf-8 -*- # $Id: prmClassesGui.py 2645 2016-05-12 06:29:38Z boman $ # @@ -80,7 +81,6 @@ class TextLine(PRMLine): self.setEnabled(self.param.enabled) def action(self): - #self.param.val = self.lineEdt.text().encode(coding) self.param.val = self.lineEdt.text() #print opt.key,'=',opt.val # update widgets visibility according to enable/disable @@ -127,11 +127,8 @@ class PathLine(PRMLine): def action(self, dir): if dir: #print "PathLine.action:dir=", dir - #self.param.val = dir.encode(coding).replace('/',os.sep) self.param.val = dir.replace('/',os.sep) - #self.lineEdt.setText(self.param.val.decode(coding)) self.lineEdt.setText(self.param.val) - #print self.param.key,'=',self.param.val # update widgets visibility according to enable/disable self.checkValidity() self.win.updateWidgetsVisibility() @@ -191,9 +188,7 @@ class FileLine(PRMLine): def action(self, file): if file: - #self.param.val = file.encode(coding).replace('/', os.sep) self.param.val = file.replace('/', os.sep) - #self.lineEdt.setText(self.param.val.decode(coding)) self.lineEdt.setText(self.param.val) #print "FileLine.action:", self.param.key,'=',self.param.val self.checkValidity() @@ -258,9 +253,7 @@ class MultiPMRLine(PRMLine): self.setEnabled(self.param.enabled) def action(self): - #self.param.val = self.comboBox.currentText().encode(coding) self.param.val = self.comboBox.currentText() - #print self.param.val self.win.updateWidgetsVisibility() self.win.updateWidgetsValues() @@ -304,7 +297,6 @@ class MultiPathLine(PRMLine): def cbIndexChangeAction(self): dir = self.comboBox.currentText() #print "cbIndexChangeAction:dir=",dir - #val = dir.encode(coding).replace('/',os.sep) val = dir.replace('/',os.sep) self.param.val = val if val in self.param.vals: # bidouille pour que la nouvelle valeur soit unique et toujours en premiere position @@ -322,7 +314,6 @@ class MultiPathLine(PRMLine): def buttonAction(self): dir = QFileDialog.getExistingDirectory(self.win, "Choose %s directory" % self.param.key, self.param.val) - #self.setDir(dir) if dir: # managing comboBox idx = self.comboBox.findData(dir) @@ -349,7 +340,6 @@ class MultiPathLine(PRMLine): self.win.updateWidgetsValues() def setParamValue(self): - #idx = self.comboBox.findText(self.param.val.decode(coding)) idx = self.comboBox.findText(self.param.val) self.comboBox.setCurrentIndex(idx)