[command line options] :
--help : affichage de l'aide
--gui : lancement du GUI
---logger : redirection des messages dans un fichier
---xterm : les serveurs ouvrent une fenêtre xterm et les messages sont affichés dans cette fenêtre
---modules=module1,module2,... : où modulen est le nom d'un module Salome à charger dans le catalogue
+--logger : redirection des messages dans un fichier
+--xterm : les serveurs ouvrent une fenêtre xterm et les messages sont affichés dans cette fenêtre
+--modules=module1,module2,... : où modulen est le nom d'un module Salome à charger dans le catalogue
--containers=cpp,python,superv: lancement des containers cpp, python et de supervision
---killall : arrêt des serveurs de salome
+--killall : arrêt des serveurs de salome
- La variable d'environnement <modulen>_ROOT_DIR doit etre préalablement
- positionnée (modulen doit etre en majuscule).
+ La variable d'environnement <modulen>_ROOT_DIR doit etre préalablement
+ positionnée (modulen doit etre en majuscule).
KERNEL_ROOT_DIR est obligatoire.
"""
# -----------------------------------------------------------------------------
#
-# Fonction d'arrêt de salome
+# Fonction d'arrêt de salome
#
def killSalome():
- print "arret des serveurs SALOME"
- for pid, cmd in process_id.items():
- print "arret du process %s : %s"% (pid, cmd[0])
+ print("arret des serveurs SALOME")
+ for pid, cmd in list(process_id.items()):
+ print("arret du process %s : %s"% (pid, cmd[0]))
try:
- os.kill(pid,signal.SIGKILL)
+ os.kill(pid, signal.SIGKILL)
except:
- print " ------------------ process %s : %s inexistant"% (pid, cmd[0])
- print "arret du naming service"
+ print(" ------------------ process %s : %s inexistant"% (pid, cmd[0]))
+ print("arret du naming service")
os.system("killall -9 omniNames")
# -----------------------------------------------------------------------------
#
def message(code, msg=''):
- if msg: print msg
+ if msg: print(msg)
sys.exit(code)
import sys,os,string,glob,time,signal,pickle,getopt
try:
for o, a in opts:
if o in ('-h', '--help'):
- print usage
+ print(usage)
sys.exit(1)
elif o in ('-g', '--gui'):
with_gui=1
liste_containers = [x.lower() for x in a.split(',')]
for r in liste_containers:
if r not in ('cpp', 'python', 'superv'):
- message(1, 'Invalid -c/--containers option: %s' % a)
+ message(1, 'Invalid -c/--containers option: %s' % a)
if 'cpp' in liste_containers:
- with_container_cpp=1
+ with_container_cpp = 1
else:
- with_container_cpp=0
+ with_container_cpp = 0
if 'python' in liste_containers:
- with_container_python=1
+ with_container_python = 1
else:
- with_container_python=0
+ with_container_python = 0
if 'superv' in liste_containers:
- with_container_superv=1
+ with_container_superv = 1
else:
- with_container_superv=0
+ with_container_superv = 0
elif o in ('-k', '--killall'):
filedict='/tmp/'+os.getenv('USER')+'_SALOME_pidict'
#filedict='/tmp/'+os.getlogin()+'_SALOME_pidict'
found = 0
try:
fpid=open(filedict, 'r')
- found = 1
+ found = 1
except:
- print "le fichier %s des process SALOME n'est pas accessible"% filedict
+ print("le fichier %s des process SALOME n'est pas accessible"% filedict)
if found:
process_id=pickle.load(fpid)
fpid.close()
killSalome()
- process_id={}
+ process_id = {}
os.remove(filedict)
-
-except getopt.error, msg:
- print usage
+
+except getopt.error as msg:
+ print(usage)
sys.exit(1)
# -----------------------------------------------------------------------------
#
-# Vérification des variables d'environnement
+# Vérification des variables d'environnement
#
try:
kernel_root_dir=os.environ["KERNEL_ROOT_DIR"]
modules_root_dir["KERNEL"]=kernel_root_dir
except:
- print usage
+ print(usage)
sys.exit(1)
for module in liste_modules :
module_root_dir=os.environ[module +"_ROOT_DIR"]
modules_root_dir[module]=module_root_dir
except:
- print usage
+ print(usage)
sys.exit(1)
# il faut KERNEL en premier dans la liste des modules
# - l'ordre des modules dans le catalogue sera identique
-# - la liste des modules presents dans le catalogue est exploitée pour charger les modules CORBA python,
+# - la liste des modules presents dans le catalogue est exploitée pour charger les modules CORBA python,
# il faut charger les modules python du KERNEL en premier
if "KERNEL" in liste_modules:liste_modules.remove("KERNEL")
#print liste_modules
#print modules_root_dir
-os.environ["SALOMEPATH"]=":".join(modules_root_dir.values())
+os.environ["SALOMEPATH"]=":".join(list(modules_root_dir.values()))
if "SUPERV" in liste_modules:with_container_superv=1
# -----------------------------------------------------------------------------
#
-# Définition des classes d'objets pour le lancement des Server CORBA
+# Définition des classes d'objets pour le lancement des Server CORBA
#
class Server:
CMD=[]
if with_xterm:
- ARGS=['xterm', '-iconic', '-sb', '-sl', '500', '-e']
+ ARGS = ['xterm', '-iconic', '-sb', '-sl', '500', '-e']
else:
- ARGS=[]
+ ARGS = []
def run(self):
args = self.ARGS+self.CMD
for module in liste_modules:
module_root_dir=modules_root_dir[module]
module_cata=module+"Catalog.xml"
- print " ", module_cata
+ print(" ", module_cata)
cata_path.extend(glob.glob(os.path.join(module_root_dir,"share","salome","resources",module_cata)))
- self.CMD=self.SCMD1 + [string.join(cata_path,':')] + self.SCMD2
+ self.CMD = self.SCMD1 + [':'.join(cata_path)] + self.SCMD2
class SalomeDSServer(Server):
CMD=['SALOMEDS_Server']
#
# Activation du GUI de Session Server
#
-
+
session.GetInterface()
#
# disponibilite dans le naming service
#
if with_logger:
- LoggerServer().run()
- clt.waitLogger("Logger")
+ LoggerServer().run()
+ clt.waitLogger("Logger")
#
# Lancement Registry Server
RegistryServer().run()
#
- # Attente de la disponibilité du Registry dans le Naming Service
+ # Attente de la disponibilité du Registry dans le Naming Service
#
clt.waitNS("/Registry")
cataServer.run()
#
- # Attente de la disponibilité du Catalog Server dans le Naming Service
+ # Attente de la disponibilité du Catalog Server dans le Naming Service
#
import SALOME_ModuleCatalog
clt.waitNS("/Kernel/ModulCatalog",SALOME_ModuleCatalog.ModuleCatalog)
SalomeDSServer().run()
if "GEOM" in liste_modules:
- print "GEOM OCAF Resources"
- os.environ["CSF_GEOMDS_ResourcesDefaults"]=os.path.join(modules_root_dir["GEOM"],"share","salome","resources")
+ print("GEOM OCAF Resources")
+ os.environ["CSF_GEOMDS_ResourcesDefaults"] = os.path.join(modules_root_dir["GEOM"], "share", "salome", "resources")
#
- # Attente de la disponibilité du SalomeDS dans le Naming Service
+ # Attente de la disponibilité du SalomeDS dans le Naming Service
#
clt.waitNS("/myStudyManager")
SessionServer().run()
#
- # Attente de la disponibilité du Session Server dans le Naming Service
+ # Attente de la disponibilité du Session Server dans le Naming Service
#
import SALOME
session=clt.waitNS("/Kernel/Session",SALOME.Session)
# Lancement Container C++ local
#
if with_container_cpp:
- ContainerCPPServer().run()
- #
- # Attente de la disponibilité du Container C++ local
- # dans le Naming Service
- #
- clt.waitNS("/Containers/" + theComputer + "/FactoryServer")
+ ContainerCPPServer().run()
+ #
+ # Attente de la disponibilité du Container C++ local
+ # dans le Naming Service
+ #
+ clt.waitNS("/Containers/" + theComputer + "/FactoryServer")
#
# Lancement Container Python local
#
if with_container_python:
- ContainerPYServer().run()
- #
- # Attente de la disponibilité du Container Python local
- # dans le Naming Service
- #
- clt.waitNS("/Containers/" + theComputer + "/FactoryServerPy")
+ ContainerPYServer().run()
+ #
+ # Attente de la disponibilité du Container Python local
+ # dans le Naming Service
+ #
+ clt.waitNS("/Containers/" + theComputer + "/FactoryServerPy")
if with_container_superv:
- #
- # Lancement Container Supervision local
- #
- ContainerSUPERVServer().run()
- #
- # Attente de la disponibilité du Container Supervision local
- # dans le Naming Service
- #
- clt.waitNS("/Containers/" + theComputer + "/SuperVisionContainer")
+ #
+ # Lancement Container Supervision local
+ #
+ ContainerSUPERVServer().run()
+ #
+ # Attente de la disponibilité du Container Supervision local
+ # dans le Naming Service
+ #
+ clt.waitNS("/Containers/" + theComputer + "/SuperVisionContainer")
#
# Activation du GUI de Session Server
#
#session.GetInterface()
end_time = os.times()
- print
- print "Start SALOME, elpased time : %5.1f seconds"% (end_time[4] - init_time[4])
+ print()
+ print("Start SALOME, elpased time : %5.1f seconds"% (end_time[4] - init_time[4]))
return clt
#
if __name__ == "__main__":
+ import codecs
clt=None
try:
clt = startSalome()
except:
- print
- print
- print "--- erreur au lancement Salome ---"
+ print()
+ print()
+ print("--- erreur au lancement Salome ---")
#print process_id
filedict='/tmp/'+os.getenv('USER')+'_SALOME_pidict'
#filedict='/tmp/'+os.getlogin()+'_SALOME_pidict'
- fpid=open(filedict, 'w')
- pickle.dump(process_id,fpid)
- fpid.close()
+ with codecs.open(filedict, 'w') as fpid:
+ pickle.dump(process_id, fpid)
- print """
+ print("""
Sauvegarde du dictionnaire des process dans , %s
Pour tuer les process SALOME, executer : python killSalome.py depuis
une console, ou bien killSalome() depuis le present interpreteur,
-s'il n'est pas fermé.
+s'il n'est pas fermé.
runHOMARD, avec l'option --killall, commence par tuer les process restants
-d'une execution précédente.
+d'une execution précédente.
Pour lancer uniquement le GUI, executer startGUI() depuis le present interpreteur,
-s'il n'est pas fermé.
+s'il n'est pas fermé.
-""" % filedict
+""" % filedict)
#
# Impression arborescence Naming Service
#
if clt != None:
- print
- print " --- registered objects tree in Naming Service ---"
+ print()
+ print(" --- registered objects tree in Naming Service ---")
clt.showNS()
session=clt.waitNS("/Kernel/Session")
catalog=clt.waitNS("/Kernel/ModulCatalog")
container = clt.waitNS("/Containers/" + socket.gethostname().split('.')[0] + "/FactoryServerPy")
if os.path.isfile("~/.salome/pystartup"):
- f=open(os.path.expanduser("~/.salome/pystartup"),'w')
- PYTHONSTARTUP=f.read()
- f.close()
+ with codecs.open(os.path.expanduser("~/.salome/pystartup")) as f:
+ PYTHONSTARTUP = f.read()
else:
PYTHONSTARTUP="""
# Add auto-completion and a stored history file of commands to your Python
# interactive interpreter. Requires Python 2.0+, readline. Autocomplete is
# bound to the TAB key by default (you can change it - see readline docs).
#
-# Store the history in ~/.salome/pyhistory,
+# Store the history in ~/.salome/pyhistory,
#
import atexit
import os
atexit.register(save_history)
del os, atexit, readline, rlcompleter, save_history, historyPath
"""
- f=open(os.path.expanduser("~/.salome/pystartup"),'w')
- f.write(PYTHONSTARTUP)
- f.close()
+ with codecs.open(os.path.expanduser("~/.salome/pystartup"), 'w') as f:
+ f.write(PYTHONSTARTUP)
- exec PYTHONSTARTUP in {}
-
+ exec(PYTHONSTARTUP, {})
Copyright EDF-R&D 2014
"""
#
- if os.environ.has_key("LOGNAME") :
+ if "LOGNAME" in os.environ :
user = os.environ ["LOGNAME"]
else :
user = "anonymous"
#
# 0.2. ==> Le user
#
- if os.environ.has_key("LOGNAME") :
+ if "LOGNAME" in os.environ :
user = os.environ ["LOGNAME"]
else :
user = "salome"
#
if self.verbose_max :
nom_fonction = __name__ + "/__init__"
- print "\nDans " + nom_fonction + ","
- print ". rep_calc :", self.rep_calc
- print ". mesh_file :", self.mesh_file
- print ". numero :", self.numero
- print ". opt1 :", self.opt1
- print ". opt2 :", self.opt2
- print ". attente :", self.attente
+ print("\nDans " + nom_fonction + ",")
+ print(". rep_calc :", self.rep_calc)
+ print(". mesh_file :", self.mesh_file)
+ print(". numero :", self.numero)
+ print(". opt1 :", self.opt1)
+ print(". opt2 :", self.opt2)
+ print(". attente :", self.attente)
#
#========================= Fin de la fonction ===================================
#
break
#
if self.verbose_max :
- print blabla
- print ". erreur :", erreur
+ print(blabla)
+ print(". erreur :", erreur)
#
return erreur, message_erreur, dico_resu
#
message_erreur = " "
#
if self.verbose_max :
- print blabla
- print ". rep_calc :", self.rep_calc
- print ". mesh_file :", self.mesh_file
- print ". tr :", self.tr
+ print(blabla)
+ print(". rep_calc :", self.rep_calc)
+ print(". mesh_file :", self.mesh_file)
+ print(". tr :", self.tr)
#
while not erreur :
#
break
#
if self.verbose_max :
- print blabla, "a la fin"
- print ". erreur :", erreur
+ print(blabla, "a la fin")
+ print(". erreur :", erreur)
#
return erreur, message_erreur
#
message_erreur = " "
#
if self.verbose_max :
- print blabla
- print ". rep_calc :", self.rep_calc
- print ". mesh_file :", self.mesh_file
- print ". numero :", self.numero
- print ". tr :", self.tr
- print ". opt1 :", self.opt1
- print ". opt2 :", self.opt2
- print ". attente :", self.attente
+ print(blabla)
+ print(". rep_calc :", self.rep_calc)
+ print(". mesh_file :", self.mesh_file)
+ print(". numero :", self.numero)
+ print(". tr :", self.tr)
+ print(". opt1 :", self.opt1)
+ print(". opt2 :", self.opt2)
+ print(". attente :", self.attente)
#
while not erreur :
#
#
# 1.2. Le repertoire de calcul
#
- if os.environ.has_key("HOME") :
+ if "HOME" in os.environ :
HOME = os.environ ["HOME"]
else :
HOME = "/local/home/salome"
#
self.nomcas = os.path.basename(self.rep_calc)
if self.verbose_max :
- print ". Cas :", self.nomcas
+ print(". Cas :", self.nomcas)
#
# 3. Le temps d'attente
#
message_erreur = messages_erreur[erreur]
#
if self.verbose_max :
- print ". rep_calc :", self.rep_calc
- print ". mesh_file :", self.mesh_file
- print ". opt1 :", self.opt1
- print ". opt2 :", self.opt2
+ print(". rep_calc :", self.rep_calc)
+ print(". mesh_file :", self.mesh_file)
+ print(". opt1 :", self.opt1)
+ print(". opt2 :", self.opt2)
#
return erreur, message_erreur
#
message_erreur = " "
#
if self.verbose_max :
- print blabla
- print ". numero :", self.numero
- print ". mesh_file :", self.mesh_file
+ print(blabla)
+ print(". numero :", self.numero)
+ print(". mesh_file :", self.mesh_file)
#
while not erreur :
#
nomfic += "." + self.numero_str + ".export"
self.nomfic_export = os.path.join(self.rep_calc, nomfic)
if self.verbose_max :
- print ". nouveau fic_export :", self.nomfic_export
+ print(". nouveau fic_export :", self.nomfic_export)
fic = open (self.nomfic_export, "w")
#
# 3. Exploration des lignes
if ( typfic == "comm" ) :
#
if self.verbose_max :
- print ". Commandes : mise a jour du nom du repertoire"
+ print(". Commandes : mise a jour du nom du repertoire")
chgt = True
nomfic_l_0 = os.path.basename(nomfic_0)
nomfic = os.path.join(self.rep_calc, nomfic_l_0)
#
elif ( ( statut == "R" ) or ( typfic == "mmed" ) ) :
if self.verbose_max :
- print ". Mise a jour du nom"
+ print(". Mise a jour du nom")
chgt = True
#
# 3.2.2.1. Le fichier de maillage est celui passe en argument
message_erreur = messages_erreur[erreur]
#
if self.verbose_max :
- print ". mclient ", self.mclient
- print ". uclient ", self.uclient
- print ". serveur ", self.serveur
- print ". username ", self.username
- print ". aster_root ", self.aster_root
- print ". nomjob ", self.nomjob
- print ". mode ", self.mode
+ print(". mclient ", self.mclient)
+ print(". uclient ", self.uclient)
+ print(". serveur ", self.serveur)
+ print(". username ", self.username)
+ print(". aster_root ", self.aster_root)
+ print(". nomjob ", self.nomjob)
+ print(". mode ", self.mode)
#
return erreur, message_erreur
#
message_erreur = " "
#
if self.verbose_max :
- print blabla
- print ". opt1 :", self.opt1
- print ". opt2 :", self.opt2
+ print(blabla)
+ print(". opt1 :", self.opt1)
+ print(". opt2 :", self.opt2)
#
while not erreur :
#
for ligne in les_lignes :
#
if self.verbose_max :
- print "ligne =", ligne[:-1]
+ print("ligne =", ligne[:-1])
#
# 3.1. Pas de modification, a priori
#
message_erreur = " "
#
if self.verbose_max :
- print blabla
- print ". numero :", self.numero
- print ". nro_couche :", self.nro_couche
- print ". nro_adap :", self.nro_adap
+ print(blabla)
+ print(". numero :", self.numero)
+ print(". nro_couche :", self.nro_couche)
+ print(". nro_adap :", self.nro_adap)
#
while not erreur :
#
for ligne in les_lignes :
#
if self.verbose_max :
- print "ligne =", ligne[:-1]
+ print("ligne =", ligne[:-1])
#
# 3.1. Pas de modification, a priori
#
message_erreur = " "
#
if self.verbose_max :
- print ". mclient ", self.mclient
- print ". serveur ", self.serveur
+ print(". mclient ", self.mclient)
+ print(". serveur ", self.serveur)
#
# 1. Copie du fichier export sur le serveur de calcul
#
nomfic_export_dist = self.nomjob + ".export"
commande = "scp " + self.nomfic_export + " " + self.username + "@" + self.serveur + ":" + nomfic_export_dist
if self.verbose_max :
- print "Copie du fichier export vers", self.serveur, ":"
- print commande
+ print("Copie du fichier export vers", self.serveur, ":")
+ print(commande)
erreur = os.system(commande)
#
# 2. Commande du lancement
commande += " 1>" + fic_caract
commande += " 2>" + fic_caract_2
if self.verbose_max :
- print "Lancement sur", self.serveur, ":"
- print commande
+ print("Lancement sur", self.serveur, ":")
+ print(commande)
#
# 3.2. Lancement vrai
#
self.message_info += self.dico["rmed"]+"\n"
#
if self.verbose_max :
- print blabla
- print ". erreur :", erreur
- print ". self.mode :", self.mode
- print ". fic_caract :", fic_caract
+ print(blabla)
+ print(". erreur :", erreur)
+ print(". self.mode :", self.mode)
+ print(". fic_caract :", fic_caract)
#
if erreur :
message_erreur = messages_erreur[erreur]
message_erreur = " "
#
if self.verbose_max :
- print ". fic_caract :", fic_caract
- print ". nomjob :", self.nomjob
- print ". rep_calc :", self.rep_calc
- print ". mode :", self.mode
- print ". attente :", self.attente
+ print(". fic_caract :", fic_caract)
+ print(". nomjob :", self.nomjob)
+ print(". rep_calc :", self.rep_calc)
+ print(". mode :", self.mode)
+ print(". attente :", self.attente)
#
if ( self.mode != "interactif" ) :
#
numjob = laux1[0]
#
if self.verbose :
- print ". numjob :", numjob
+ print(". numjob :", numjob)
#
# 2. Commande de l'examen de l'etat du job,
#
commande_base = os.path.join(self.aster_root, "bin", "as_run")
commande_base += " --actu " + numjob + " " + self.nomjob + " " + self.mode
if self.verbose_max :
- print "commande_base =", commande_base
+ print("commande_base =", commande_base)
if ( self.mclient == self.serveur ) :
commande = commande_base
else :
commande += " 1>" + fic_etat
commande += " 2>" + fic_etat_2
if self.verbose_max :
- print "Examen sur", self.serveur, ":"
- print commande
+ print("Examen sur", self.serveur, ":")
+ print(commande)
#
# 3. Examen de l'etat du job, jusqu'a la fin
#
#
if encore % 4 == 0 :
aux = ((encore-1)*self.attente) / 60
- print "..", aux, "mn"
+ print("..", aux, "mn")
#print diag
#
time.sleep(self.attente)
laux1 = laux[1].split("=")
diag = laux1[1]
if self.verbose_max :
- print etat, diag
+ print(etat, diag)
if etat in ( "RUN", "PEND" ) :
encore += 1
else :
os.remove(fic_etat_2)
#
if self.verbose_max :
- print blabla
- print ". erreur :", erreur
+ print(blabla)
+ print(". erreur :", erreur)
#
if erreur :
message_erreur = "Erreur dans le calcul"
message_erreur = " "
#
dico_resu = {}
- for cle in dico_resu_init.keys() :
- dico_resu[cle] = dico_resu_init[cle]
+ dico_resu.update(dico_resu_init)
#
while not erreur :
#
break
#
if self.verbose :
- print blabla
- print ". erreur :", erreur
- print ". dico_resu :", dico_resu
+ print(blabla)
+ print(". erreur :", erreur)
+ print(". dico_resu :", dico_resu)
#
if erreur :
message_erreur = messages_erreur[erreur]
nom_fonction = __name__ + "/post_aster_1"
blabla = "\nDans " + nom_fonction + " :"
if self.verbose_max :
- print blabla, "nomfic =", nomfic, "chaine =", chaine, ", nuocc =", nuocc
+ print(blabla, "nomfic =", nomfic, "chaine =", chaine, ", nuocc =", nuocc)
#
trouve = False
erreur = 0
erreur = -1
#
if ( self.verbose_max or ( erreur>0 ) ) :
- print blabla, "nomfic =", nomfic, "chaine =", chaine, ", nuocc =", nuocc
- print ". erreur =", erreur
+ print(blabla, "nomfic =", nomfic, "chaine =", chaine, ", nuocc =", nuocc)
+ print(". erreur =", erreur)
#
if erreur :
message_erreur = messages_erreur[erreur]
self.message_info += fic_dump+"\n"
#
if self.verbose_max :
- print blabla
- print ". erreur :", erreur
+ print(blabla)
+ print(". erreur :", erreur)
#
os.remove(nomfic_donn)
#
#
if self.verbose_max :
nom_fonction = __name__ + "/__init__"
- print "\nDans " + nom_fonction + ","
- print ". rep_calc :", self.rep_calc
- print ". mesh_file :", self.mesh_file
- print ". numero :", self.numero
+ print("\nDans " + nom_fonction + ",")
+ print(". rep_calc :", self.rep_calc)
+ print(". mesh_file :", self.mesh_file)
+ print(". numero :", self.numero)
#
#========================= Fin de la fonction ===================================
#
break
#
if self.verbose_max :
- print blabla
- print ". erreur :", erreur
+ print(blabla)
+ print(". erreur :", erreur)
#
return erreur, message_erreur, dico_resu
#
message_erreur = " "
#
if self.verbose_max :
- print blabla
- print ". rep_calc :", self.rep_calc
- print ". mesh_file :", self.mesh_file
- print ". numero :", self.numero
+ print(blabla)
+ print(". rep_calc :", self.rep_calc)
+ print(". mesh_file :", self.mesh_file)
+ print(". numero :", self.numero)
#
while not erreur :
#
#
# 1.2. Le repertoire de calcul
#
- if os.environ.has_key("HOME") :
+ if "HOME" in os.environ :
HOME = os.environ ["HOME"]
else :
HOME = "/local/home/salome"
message_erreur = messages_erreur[erreur]
#
if self.verbose_max :
- print ". rep_calc :", self.rep_calc
- print ". mesh_file :", self.mesh_file
+ print(". rep_calc :", self.rep_calc)
+ print(". mesh_file :", self.mesh_file)
#
return erreur, message_erreur
#
# see salome_shared_modules.py
# (avoids incomplete import at run time)
-print "============== import HOMARD ======================="
+print("============== import HOMARD =======================")
import HOMARD
dico["-1"] = "deraffinement"
# Creation of the hypothesis a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM
hyponame_1 = "a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM"
- print "-------- Creation of the hypothesis", hyponame_1
+ print("-------- Creation of the hypothesis", hyponame_1)
hypo_1_1 = HOMARD.CreateHypothesis(hyponame_1)
hypo_1_1.SetField('RESU____ERRE_ELEM_SIGM__________')
hypo_1_1.SetUseComp(0)
hypo_1_1.SetRefinThr(3, 10.1)
hypo_1_1.AddFieldInterp('RESU____DEPL____________________')
hypo_1_1.AddFieldInterp('RESU____ERRE_ELEM_SIGM__________')
- print hyponame_1, " : champ utilisé :", hypo_1_1.GetFieldName()
- print hyponame_1, " : composantes utilisées :", hypo_1_1.GetComps()
+ print(hyponame_1, " : champ utilisé :", hypo_1_1.GetFieldName())
+ print(hyponame_1, " : composantes utilisées :", hypo_1_1.GetComps())
if ( len (hypo_1_1.GetFieldName()) > 0 ) :
- print ".. caractéristiques de l'adaptation :", hypo_1_1.GetField()
- print hyponame_1, " : champs interpolés :", hypo_1_1.GetFieldInterps()
+ print(".. caractéristiques de l'adaptation :", hypo_1_1.GetField())
+ print(hyponame_1, " : champs interpolés :", hypo_1_1.GetFieldInterps())
# Creation of the hypothesis Zones_1_et_2
hyponame_2 = "Zones_1_et_2"
- print "-------- Creation of the hypothesis", hyponame_2
+ print("-------- Creation of the hypothesis", hyponame_2)
zones_1_et_2 = HOMARD.CreateHypothesis(hyponame_2)
zones_1_et_2.AddZone('Zone_1_1', 1)
zones_1_et_2.AddZone('Zone_1_2', 1)
laux = zones_1_et_2.GetZones()
- nbzone = len(laux)/2
+ nbzone = len(laux) // 2
jaux = 0
- for iaux in range(nbzone) :
- print hyponame_2, " : ", dico[laux[jaux+1]], "sur la zone", laux[jaux]
+ for _ in range(nbzone) :
+ print(hyponame_2, " : ", dico[laux[jaux+1]], "sur la zone", laux[jaux])
jaux += 2
- print hyponame_2, " : champ utilisé :", zones_1_et_2.GetFieldName()
+ print(hyponame_2, " : champ utilisé :", zones_1_et_2.GetFieldName())
if ( len (zones_1_et_2.GetFieldName()) > 0 ) :
- print ".. caractéristiques de l'adaptation :", zones_1_et_2.GetField()
- print hyponame_2, " : champs interpolés :", zones_1_et_2.GetFieldInterps()
+ print(".. caractéristiques de l'adaptation :", zones_1_et_2.GetField())
+ print(hyponame_2, " : champs interpolés :", zones_1_et_2.GetFieldInterps())
#
# Creation of the cases
# =====================
# Creation of the case
- print "-------- Creation of the case", TEST_NAME
+ print("-------- Creation of the case", TEST_NAME)
mesh_file = os.path.join(REP_DATA, TEST_NAME + '.00.med')
case_test_1 = HOMARD.CreateCase(TEST_NAME, 'MAILL', mesh_file)
case_test_1.SetDirName(DIRCASE)
# ==========================
# Creation of the iteration 1
iter_name = "I_" + TEST_NAME + "_1"
- print "-------- Creation of the iteration", iter_name
+ print("-------- Creation of the iteration", iter_name)
iter_test_1_1 = case_test_1.NextIteration(iter_name)
iter_test_1_1.AssociateHypo(hyponame_1)
- print ". Hypothese :", hyponame_1
+ print(". Hypothese :", hyponame_1)
iter_test_1_1.SetMeshName('M1')
iter_test_1_1.SetMeshFile(os.path.join(DIRCASE, 'maill.01.med'))
iter_test_1_1.SetFieldFile(os.path.join(REP_DATA, TEST_NAME + '.00.med'))
iter_test_1_1.SetTimeStepRank(1, 1)
iter_test_1_1.SetFieldInterpTimeStep('RESU____DEPL____________________', 1)
iter_test_1_1.SetFieldInterpTimeStepRank('RESU____ERRE_ELEM_SIGM__________', 1, 1)
- print ". Instants d'interpolation :", iter_test_1_1.GetFieldInterpsTimeStepRank()
+ print(". Instants d'interpolation :", iter_test_1_1.GetFieldInterpsTimeStepRank())
error = iter_test_1_1.Compute(1, 1)
if error :
error = 1
# Creation of the iteration 2
iter_name = "I_" + TEST_NAME + "_2"
- print "-------- Creation of the iteration", iter_name
+ print("-------- Creation of the iteration", iter_name)
iter_test_1_2 = iter_test_1_1.NextIteration(iter_name)
iter_test_1_2.AssociateHypo(hyponame_1)
- print ". Hypothese :", hyponame_1
+ print(". Hypothese :", hyponame_1)
iter_test_1_2.SetMeshName('M2')
iter_test_1_2.SetMeshFile(os.path.join(DIRCASE, 'maill.02.med'))
iter_test_1_2.SetFieldFile(os.path.join(REP_DATA, TEST_NAME + '.01.med'))
iter_test_1_2.SetTimeStepRank(1, 1)
iter_test_1_2.SetFieldInterpTimeStep('RESU____DEPL____________________', 1)
iter_test_1_2.SetFieldInterpTimeStepRank('RESU____ERRE_ELEM_SIGM__________', 1, 1)
- print ". Instants d'interpolation :", iter_test_1_2.GetFieldInterpsTimeStepRank()
+ print(". Instants d'interpolation :", iter_test_1_2.GetFieldInterpsTimeStepRank())
error = iter_test_1_2.Compute(1, 1)
if error :
error = 2
# Creation of the iteration 3
iter_name = "I_" + TEST_NAME + "_3"
- print "-------- Creation of the iteration", iter_name
+ print("-------- Creation of the iteration", iter_name)
iter_test_1_3 = iter_test_1_2.NextIteration(iter_name)
iter_test_1_3.AssociateHypo(hyponame_2)
- print ". Hypothese :", hyponame_2
+ print(". Hypothese :", hyponame_2)
iter_test_1_3.SetMeshName('M3')
iter_test_1_3.SetMeshFile(os.path.join(DIRCASE, 'maill.03.med'))
iter_test_1_2.SetFieldFile(os.path.join(REP_DATA, TEST_NAME + '.02.med'))
- print ". Instants d'interpolation :", iter_test_1_3.GetFieldInterpsTimeStepRank()
+ print(". Instants d'interpolation :", iter_test_1_3.GetFieldInterpsTimeStepRank())
error = iter_test_1_3.Compute(1, 1)
if error :
error = 3
ERROR = homard_exec(salome.myStudy)
if ERROR :
raise Exception('Pb in homard_exec at iteration %d' %ERROR )
-except Exception, eee:
- raise Exception('Pb in homard_exec: '+eee.message)
+except Exception as eee:
+ raise Exception('Pb in homard_exec: ' + str(eee))
#
# Test of the results
#
# ==========================
# Creation of the hypothesis 1
hyponame_1 = "hypo_" + TEST_NAME + "_1"
- print "-------- Creation of the hypothesis", hyponame_1
+ print("-------- Creation of the hypothesis", hyponame_1)
hypo_test_2_1 = HOMARD.CreateHypothesis(hyponame_1)
hypo_test_2_1.SetUnifRefinUnRef(1)
hypo_test_2_1.AddGroup('EG')
hypo_test_2_1.AddGroup('BANDE')
- print hyponame_1, " : zones utilisées :", hypo_test_2_1.GetZones()
- print hyponame_1, " : champ utilisé :", hypo_test_2_1.GetFieldName()
- print hyponame_1, " : composantes utilisées :", hypo_test_2_1.GetComps()
+ print(hyponame_1, " : zones utilisées :", hypo_test_2_1.GetZones())
+ print(hyponame_1, " : champ utilisé :", hypo_test_2_1.GetFieldName())
+ print(hyponame_1, " : composantes utilisées :", hypo_test_2_1.GetComps())
if ( len (hypo_test_2_1.GetFieldName()) > 0 ) :
- print ".. caractéristiques de l'adaptation :", hypo_test_2_1.GetField()
+ print(".. caractéristiques de l'adaptation :", hypo_test_2_1.GetField())
# Creation of the hypothesis 2
hyponame_2 = "hypo_" + TEST_NAME + "_2"
- print "-------- Creation of the hypothesis", hyponame_2
+ print("-------- Creation of the hypothesis", hyponame_2)
hypo_test_2_2 = HOMARD.CreateHypothesis(hyponame_2)
hypo_test_2_2.SetUnifRefinUnRef(1)
hypo_test_2_2.AddGroup('M_D')
- print hyponame_2, " : zones utilisées :", hypo_test_2_2.GetZones()
- print hyponame_2, " : champ utilisé :", hypo_test_2_2.GetFieldName()
- print hyponame_2, " : composantes utilisées :", hypo_test_2_2.GetComps()
+ print(hyponame_2, " : zones utilisées :", hypo_test_2_2.GetZones())
+ print(hyponame_2, " : champ utilisé :", hypo_test_2_2.GetFieldName())
+ print(hyponame_2, " : composantes utilisées :", hypo_test_2_2.GetComps())
if ( len (hypo_test_2_2.GetFieldName()) > 0 ) :
- print ".. caractéristiques de l'adaptation :", hypo_test_2_2.GetField()
+ print(".. caractéristiques de l'adaptation :", hypo_test_2_2.GetField())
#
# Creation of the cases
# =====================
ERROR = homard_exec(salome.myStudy)
if ERROR :
raise Exception('Pb in homard_exec at iteration %d' %ERROR )
-except Exception, eee:
+except Exception as eee:
raise Exception('Pb in homard_exec: '+eee.message)
#
# Test of the results
# ==========================
# Uniform refinement
hyponame = "hypo_" + TEST_NAME
- print "-------- Creation of the hypothesis", hyponame
+ print("-------- Creation of the hypothesis", hyponame)
hypo_test_3 = HOMARD.CreateHypothesis(hyponame)
hypo_test_3.SetUnifRefinUnRef(1)
- print hyponame, " : zones utilisées :", hypo_test_3.GetZones()
- print hyponame, " : champ utilisé :", hypo_test_3.GetFieldName()
- print hyponame, " : composantes utilisées :", hypo_test_3.GetComps()
+ print(hyponame, " : zones utilisées :", hypo_test_3.GetZones())
+ print(hyponame, " : champ utilisé :", hypo_test_3.GetFieldName())
+ print(hyponame, " : composantes utilisées :", hypo_test_3.GetComps())
#
for num in range (N_BOUCLE+1) :
#
- print "-------- num =", num, "--------"
+ print("-------- num =", num, "--------")
#
# Creation of the case case_test_3
# ===========================
if ( num <= 1 ) :
- print "-------- Creation of the case", TEST_NAME
+ print("-------- Creation of the case", TEST_NAME)
mesh_file = os.path.join(REP_DATA, TEST_NAME + '.00.med')
case_test_3 = HOMARD.CreateCase(TEST_NAME, 'MOYEU', mesh_file)
case_test_3.SetDirName(DIRCASE)
# ==========================
# Creation of the iteration 1
iter_name = "I_" + TEST_NAME + "_1"
- print "-------- Creation of the iteration", iter_name
+ print("-------- Creation of the iteration", iter_name)
iter_test_3_1 = case_test_3.NextIteration(iter_name)
iter_test_3_1.SetMeshName('MOYEU_1')
iter_test_3_1.SetMeshFile(os.path.join(DIRCASE, 'maill.01.med'))
# Creation of the iteration 2
iter_name = "I_" + TEST_NAME + "_2"
- print "-------- Creation of the iteration", iter_name
+ print("-------- Creation of the iteration", iter_name)
iter_test_3_2 = iter_test_3_1.NextIteration(iter_name)
iter_test_3_2.SetMeshName('MOYEU_2')
iter_test_3_2.SetMeshFile(os.path.join(DIRCASE, 'maill.02.med'))
scriptfile = os.path.normpath(scriptfile)
dirname = DIRCASE
yacsname = "YACS_" + TEST_NAME
- print "-------- Creation of the schema", yacsname
+ print("-------- Creation of the schema", yacsname)
yacs_test_3 = case_test_3.CreateYACSSchema(yacsname, scriptfile, dirname, mesh_file)
yacs_test_3.SetType(2)
yacs_test_3.SetMaxIter(2)
# ============
# Destruction of the schema, sauf a la fin
if ( num < N_BOUCLE ) :
- print "-------- Destruction of the schema", yacs_test_3.GetName()
+ print("-------- Destruction of the schema", yacs_test_3.GetName())
error = yacs_test_3.Delete(1)
if error :
error = 10*num + 6
# After the first loop, the case is deleted, except the final mesh files
# All the iterations are deleted
if ( num == 0 ) :
- print "-------- Destruction of the case", case_test_3.GetName()
+ print("-------- Destruction of the case", case_test_3.GetName())
error = case_test_3.Delete(0)
if error :
break
# After the second loop, the iterations are deleted, with the final mesh files
elif ( num == 1 ) :
# Recursive destruction of the iterations
- print "-------- Recursive destruction of the iteration", iter_test_3_1.GetName()
+ print("-------- Recursive destruction of the iteration", iter_test_3_1.GetName())
error = iter_test_3_1.Delete(1)
if error :
error = 10*num + 3
break
# Destruction and creation of the hypothese
if ( num == 1 ) :
- print "-------- Destruction of the hypothese", hypo_test_3.GetName()
+ print("-------- Destruction of the hypothese", hypo_test_3.GetName())
error = hypo_test_3.Delete()
if error :
error = 10*num + 4
break
hyponame = "hypo_test_3"
- print "-------- Creation of the hypothesis", hyponame
+ print("-------- Creation of the hypothesis", hyponame)
hypo_test_3 = HOMARD.CreateHypothesis(hyponame)
hypo_test_3.SetUnifRefinUnRef(1)
#
ERROR = homard_exec(salome.myStudy)
if ERROR :
raise Exception('Pb in homard_exec at iteration %d' %ERROR )
-except Exception, eee:
+except Exception as eee:
raise Exception('Pb in homard_exec: '+eee.message)
#
# Test of the results
try:
ficmed = os.path.join(DIRCASE, 'maill.00.med')
box_m.ExportMED( ficmed, 0, SMESH.MED_V2_2, 1, None, 1)
- except Exception, eee:
+ except Exception as eee:
error = 2
raise Exception('ExportToMEDX() failed. '+eee.message)
#
valeur[iaux] = 1.e0 / max ( 1.e-5, np.sqrt(distance) )
#print ". valeur", valeur
nparr = valeur.toNumPyArray()
- print ". mini/maxi", nparr.min(), nparr.max()
+ print(". mini/maxi", nparr.min(), nparr.max())
#
# Creation of the field
# =====================
dico["-1"] = "deraffinement"
# Creation of the hypothesis hypo_4_1
hyponame_1 = "Zone_1"
- print "-------- Creation of the hypothesis", hyponame_1
+ print("-------- Creation of the hypothesis", hyponame_1)
hypo_4_1 = HOMARD.CreateHypothesis(hyponame_1)
hypo_4_1.AddZone('Zone_4_1', 1)
hypo_4_1.SetExtraOutput(2)
nbzone = len(laux)/2
jaux = 0
for iaux in range(nbzone) :
- print hyponame_1, " : ", dico[laux[jaux+1]], "sur la zone", laux[jaux]
+ print(hyponame_1, " : ", dico[laux[jaux+1]], "sur la zone", laux[jaux])
jaux += 2
# Creation of the hypothesis hypo_4_2
hyponame_2 = "Zone_2"
- print "-------- Creation of the hypothesis", hyponame_2
+ print("-------- Creation of the hypothesis", hyponame_2)
hypo_4_2 = HOMARD.CreateHypothesis(hyponame_2)
hypo_4_2.AddZone('Zone_4_2', 1)
hypo_4_2.SetExtraOutput(2)
nbzone = len(laux)/2
jaux = 0
for iaux in range(nbzone) :
- print hyponame_2, " : ", dico[laux[jaux+1]], "sur la zone", laux[jaux]
+ print(hyponame_2, " : ", dico[laux[jaux+1]], "sur la zone", laux[jaux])
jaux += 2
# Creation of the hypothesis DISTANCE INVERSE
hyponame_3 = "DISTANCE INVERSE"
- print "-------- Creation of the hypothesis", hyponame_3
+ print("-------- Creation of the hypothesis", hyponame_3)
hypo_4_3 = HOMARD.CreateHypothesis(hyponame_3)
hypo_4_3.SetField('DISTANCE')
hypo_4_3.SetUseComp(0)
hypo_4_3.SetUnRefThr(1, 0.2)
hypo_4_3.AddFieldInterp('DISTANCE')
hypo_4_3.SetExtraOutput(2)
- print hyponame_3, " : zones utilisées :", hypo_4_3.GetZones()
- print hyponame_3, " : champ utilisé :", hypo_4_3.GetFieldName()
- print hyponame_3, " : composantes utilisées :", hypo_4_3.GetComps()
+ print(hyponame_3, " : zones utilisées :", hypo_4_3.GetZones())
+ print(hyponame_3, " : champ utilisé :", hypo_4_3.GetFieldName())
+ print(hyponame_3, " : composantes utilisées :", hypo_4_3.GetComps())
if ( len (hypo_4_3.GetFieldName()) > 0 ) :
- print ".. caractéristiques de l'adaptation :", hypo_4_3.GetField()
- print hyponame_3, " : champs interpolés :", hypo_4_3.GetFieldInterps()
+ print(".. caractéristiques de l'adaptation :", hypo_4_3.GetField())
+ print(hyponame_3, " : champs interpolés :", hypo_4_3.GetFieldInterps())
#
# Creation of the cases
# =====================
# Creation of the case
- print "-------- Creation of the case", TEST_NAME
+ print("-------- Creation of the case", TEST_NAME)
mesh_file = os.path.join(DIRCASE, 'maill.00.med')
case_test_4 = HOMARD.CreateCase(TEST_NAME, 'MESH', mesh_file)
case_test_4.SetDirName(DIRCASE)
# ==========================
# Creation of the iteration 1
iter_name = "I_" + TEST_NAME + "_1"
- print "-------- Creation of the iteration", iter_name
+ print("-------- Creation of the iteration", iter_name)
iter_test_4_1 = case_test_4.NextIteration(iter_name)
iter_test_4_1.AssociateHypo(hyponame_1)
- print ". Hypothese :", hyponame_1
+ print(". Hypothese :", hyponame_1)
iter_test_4_1.SetMeshName('M1')
iter_test_4_1.SetMeshFile(os.path.join(DIRCASE, 'maill.01.med'))
error = iter_test_4_1.Compute(1, 2)
# Creation of the iteration 2
iter_name = "I_" + TEST_NAME + "_2"
- print "-------- Creation of the iteration", iter_name
+ print("-------- Creation of the iteration", iter_name)
iter_test_4_2 = iter_test_4_1.NextIteration(iter_name)
iter_test_4_2.AssociateHypo(hyponame_2)
- print ". Hypothese :", hyponame_2
+ print(". Hypothese :", hyponame_2)
iter_test_4_2.SetMeshName('M2')
iter_test_4_2.SetMeshFile(os.path.join(DIRCASE, 'maill.02.med'))
error = iter_test_4_2.Compute(1, 2)
break
#
iter_name = "I_" + TEST_NAME + "_3"
- print "-------- Creation of the iteration", iter_name
+ print("-------- Creation of the iteration", iter_name)
iter_test_4_3 = iter_test_4_2.NextIteration(iter_name)
iter_test_4_3.AssociateHypo(hyponame_3)
- print ". Hypothese :", hyponame_3
+ print(". Hypothese :", hyponame_3)
iter_test_4_3.SetMeshName('M3')
iter_test_4_3.SetFieldFile(os.path.join(DIRCASE, 'maill.02.med'))
iter_test_4_3.SetMeshFile(os.path.join(DIRCASE, 'maill.03.med'))
ERROR = geom_smesh_exec(salome.myStudy)
if ERROR :
raise Exception('Pb in geom_smesh_exec')
-except Exception, eee:
+except Exception as eee:
raise Exception('Pb in geom_smesh_exec: '+eee.message)
HOMARD = salome.lcc.FindOrLoadComponent('FactoryServer', 'HOMARD')
ERROR = homard_exec(salome.myStudy)
if ERROR :
raise Exception('Pb in homard_exec at iteration %d' %ERROR )
-except Exception, eee:
+except Exception as eee:
raise Exception('Pb in homard_exec: '+eee.message)
#
# Test of the results
ficmed = os.path.join(DIRCASE, 'maill.00.med')
#print "Ecriture du maillage dans le fichier", ficmed
meshMEDFile3D.write(ficmed, 2)
- except Exception, eee:
+ except Exception as eee:
error = 2
raise Exception('ExportToMEDX() failed. '+eee.message)
#
valeur[num_mail] = 1.e0 / max ( 1.e-5, distance)
#print ". valeur", valeur
nparr = valeur.toNumPyArray()
- print ". mini/maxi", nparr.min(), nparr.max()
+ print(". mini/maxi", nparr.min(), nparr.max())
#
# Creation of the field
# =====================
# Creation of the hypothese DISTANCE INVERSE
# ==========================================
hyponame = "DISTANCE INVERSE"
- print "-------- Creation of the hypothesis", hyponame
+ print("-------- Creation of the hypothesis", hyponame)
hypo_5 = HOMARD.CreateHypothesis(hyponame)
hypo_5.SetField('DISTANCE')
hypo_5.SetUseComp(0)
hypo_5.SetRefinThr(1, 0.020)
hypo_5.SetUnRefThr(1, 0.015)
- print hyponame, " : champ utilisé :", hypo_5.GetFieldName()
- print ".. caractéristiques de l'adaptation :", hypo_5.GetField()
+ print(hyponame, " : champ utilisé :", hypo_5.GetFieldName())
+ print(".. caractéristiques de l'adaptation :", hypo_5.GetField())
#
# Creation of the cases
# =====================
# Creation of the case
- print "-------- Creation of the case", TEST_NAME
+ print("-------- Creation of the case", TEST_NAME)
mesh_file = os.path.join(DIRCASE, 'maill.00.med')
case_test_5 = HOMARD.CreateCase(TEST_NAME, 'MESH', mesh_file)
case_test_5.SetDirName(DIRCASE)
# Creation of the iteration
#
iter_name = "I_" + TEST_NAME + "_" + s_niterp1
- print "-------- Creation of the iteration", iter_name
+ print("-------- Creation of the iteration", iter_name)
if ( niter == 0 ) :
iter_test_5 = case_test_5.NextIteration(iter_name)
else :
ERROR = mesh_exec(salome.myStudy)
if ERROR :
raise Exception('Pb in mesh_exec')
-except Exception, eee:
+except Exception as eee:
raise Exception('Pb in mesh_exec: '+eee.message)
HOMARD = salome.lcc.FindOrLoadComponent('FactoryServer', 'HOMARD')
ERROR = homard_exec(salome.myStudy)
if ERROR :
raise Exception('Pb in homard_exec at iteration %d' %ERROR )
-except Exception, eee:
+except Exception as eee:
raise Exception('Pb in homard_exec: '+eee.message)
#
# Test of the results
ERROR = homard_exec(salome.myStudy)
if ERROR :
raise Exception('Pb in homard_exec at iteration %d' %ERROR )
-except Exception, eee:
+except Exception as eee:
raise Exception('Pb in homard_exec: '+eee.message)
#
# Test of the results
ERROR = homard_exec(salome.myStudy)
if ERROR :
raise Exception('Pb in homard_exec at iteration %d' %ERROR )
-except Exception, eee:
+except Exception as eee:
raise Exception('Pb in homard_exec: '+eee.message)
#
# Test of the results
ERROR = homard_exec(salome.myStudy)
if ERROR :
raise Exception('Pb in homard_exec at iteration %d' %ERROR )
-except Exception, eee:
+except Exception as eee:
raise Exception('Pb in homard_exec: '+eee.message)
#
# Test of the results
ERROR = homard_exec(salome.myStudy)
if ERROR :
raise Exception('Pb in homard_exec at iteration %d' %ERROR )
-except Exception, eee:
+except Exception as eee:
raise Exception('Pb in homard_exec: '+eee.message)
#
# Test of the results
ERROR = homard_exec(salome.myStudy)
if ERROR :
raise Exception('Pb in homard_exec at iteration %d' %ERROR )
-except Exception, eee:
+except Exception as eee:
raise Exception('Pb in homard_exec: '+eee.message)
#
# Test of the results