Skip to content
Snippets Groups Projects
Commit 93820cd2 authored by Boman Romain's avatar Boman Romain
Browse files

futurize pyw

parent 5cec6bf0
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@
# Gui to configure externals program path according to local configuration
## Qt ##
from __future__ import print_function
foundQt=0
try:
from PyQt4.QtCore import *
......@@ -137,20 +138,20 @@ class ExtProgsConfGui(QWidget):
def updateWidgetsValues(self):
self.extProgPath.applyDependencies()
if self.extProgPath.debug :
print "updateWidgetsValues"
print("updateWidgetsValues")
for var in self.sf:
self.sf[var].setParamValue()
def updateWidgetsVisibility(self):
if self.extProgPath.debug :
print "updateWidgetsVisibility"
print("updateWidgetsVisibility")
# update enabled/disabled of options
self.extProgPath.configActions()
for var in self.sf:
self.sf[var].setEnabled(self.extProgPath.pars[var].enabled)
def updateWidgetsValues(self):
if self.extProgPath.debug :
print "updateWidgetsVisibility"
print("updateWidgetsVisibility")
# update enabled/disabled of options
self.extProgPath.configActions()
for var in self.sf:
......@@ -158,17 +159,17 @@ class ExtProgsConfGui(QWidget):
def userSave(self):
if self.extProgPath.debug :
print "Save pressed"
print("Save pressed")
self.extProgPath.savePars()
def progSave(self):
if self.extProgPath.debug :
print "Save pressed"
print("Save pressed")
self.extProgPath.savePars('.')
def quit(self):
if self.extProgPath.debug :
print "Quit pressed"
print("Quit pressed")
sys.exit()
......
......@@ -11,6 +11,9 @@
# unicodestr.encode('ascii','ignore')
#
from __future__ import print_function
from builtins import map
from builtins import str
import os,sys
from prmClassesGui import *
from launch import *
......@@ -239,7 +242,7 @@ class LaunchGui(QWidget):
# ----------------------------------------------------------------------------------
def go(self):
print "Go pressed"
print("Go pressed")
# disable the gui modifications during run
self.guiEnable(False)
......@@ -274,7 +277,7 @@ class LaunchGui(QWidget):
# launch.go() ...
self.launch.go()
except Exception, e:
except Exception as e:
#print e
QMessageBox.information(self, 'Error', str(e))
......@@ -282,9 +285,9 @@ class LaunchGui(QWidget):
self.guiEnable(True)
def interrupt(self):
print "interrupt pressed"
print("interrupt pressed")
self.process.kill()
print "interrupt done"
print("interrupt done")
# Boucle d'execution du Qprocess avec recuperation des events
def waitQProcessForFinish(self):
......@@ -300,25 +303,25 @@ class LaunchGui(QWidget):
return retcode
def save(self):
print "Save pressed"
print("Save pressed")
self.baseDir.savePars()
#self.launch.printPars()
self.launch.savePars()
def quit(self):
print "Quit pressed"
print("Quit pressed")
sys.exit()
def updateWidgetsValues(self):
self.launch.applyDependencies()
if self.launch.debug :
print "updateWidgetsValues"
print("updateWidgetsValues")
for var in self.sf:
self.sf[var].setParamValue()
def updateWidgetsVisibility(self):
if self.launch.debug :
print "updateWidgetsVisibility"
print("updateWidgetsVisibility")
# update enabled/disabled of options
self.launch.configActions()
for var in self.sf:
......@@ -367,7 +370,7 @@ class LaunchGui(QWidget):
def write(self, stuff):
if '\n' in stuff:
map( self.writeLine, stuff.split("\n") )
list(map( self.writeLine, stuff.split("\n") ))
else:
self.buf += stuff
self.app.processEvents()
......@@ -386,14 +389,14 @@ def main():
#define launcher
launch = LaunchJob()
if launch.debug :
print "launch defined"
print("launch defined")
# create gui
launchGui = LaunchGui(launch)
# opening Gui
launchGui.show()
# signal pour cloturer proprement l'application PyQt quand on ferme la fenetre
launchGui.app.lastWindowClosed.connect(launchGui.app.quit)
print "ready."
print("ready.")
sys.exit(launchGui.app.exec_())
if __name__=="__main__":
......
......@@ -7,6 +7,7 @@
#
## Qt ##
from __future__ import print_function
foundQt=0
try:
from PyQt4.QtCore import *
......@@ -176,13 +177,13 @@ class PostProLoopGui(QWidget):
def updateWidgetsValues(self):
self.postProLoop.applyDependencies()
if self.postProLoop.debug:
print "updateWidgetsValues"
print("updateWidgetsValues")
for var in self.sf:
self.sf[var].setParamValue()
def updateWidgetsVisibility(self):
if self.postProLoop.debug:
print "updateWidgetsVisibility"
print("updateWidgetsVisibility")
# update enabled/disabled of options
self.postProLoop.configActions()
for var in self.sf:
......@@ -190,7 +191,7 @@ class PostProLoopGui(QWidget):
def updateWidgetsValues(self):
if self.postProLoop.debug:
print "updateWidgetsVisibility"
print("updateWidgetsVisibility")
# update enabled/disabled of options
self.postProLoop.configActions()
for var in self.sf:
......@@ -198,17 +199,17 @@ class PostProLoopGui(QWidget):
def go(self):
if self.postProLoop.debug:
print "Go pressed"
print("Go pressed")
self.postProLoop.go()
def save(self):
if self.postProLoop.debug:
print "Save pressed"
print("Save pressed")
self.postProLoop.savePars('.')
def quit(self):
if self.postProLoop.debug:
print "Quit pressed"
print("Quit pressed")
sys.exit()
# ============== Main ========================
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment