-# Copyright (C) 2006-2013 CEA/DEN, EDF R&D
+# Copyright (C) 2006-2020 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
return self.p.getIds()
def runProc(self,debug, isPyThread, fromscratch):
- print "**************************Begin schema execution %s**************************" % self.xmlFile
+ print("**************************Begin schema execution %s**************************" % self.xmlFile)
self.e.RunPy(self.p,debug, isPyThread, fromscratch)
- print "**************************End schema execution %s****************************" % self.xmlFile
+ print("**************************End schema execution %s****************************" % self.xmlFile)
def Run(self):
if self.run1 is not None:
self.run1 = None
if self.run1 is None:
- self.run1 = threading.Thread(None, self.runProc, "CORBAExec", (0,1,1))
+ self.run1 = threading.Thread(None, self.runProc, "CORBAExec", (0,True,True))
self.run1.start()
def RunFromState(self, xmlFile):
sp = loader.stateParser()
sl = loader.stateLoader(sp,self.p)
sl.parse(xmlFile)
- except IOError, ex:
- print "IO Error: ", ex
+ except IOError as ex:
+ print("IO Error: ", ex)
return
- except ValueError,ex:
- print "Caught ValueError Exception:",ex
+ except ValueError as ex:
+ print("Caught ValueError Exception:",ex)
return
- except pilot.Exception,ex:
- print ex.what()
+ except pilot.Exception as ex:
+ print(ex.what())
return
except:
- print "Unknown exception!"
+ print("Unknown exception!")
return
if self.run1 is None:
- self.run1 = threading.Thread(None, self.runProc, "CORBAExec", (0,1,0))
+ self.run1 = threading.Thread(None, self.runProc, "CORBAExec", (0,True,False))
self.run1.start()
def RestartFromState(self, xmlFile):
pass
if self.run1 is None:
- self.run1 = threading.Thread(None, self.runProc, "CORBAExec", (0,1,0))
+ self.run1 = threading.Thread(None, self.runProc, "CORBAExec", (0,True,False))
self.run1.start()
def addObserver(self, obs, numid, event):
"""
def __init__ ( self, orb, poa, contID, containerName, instanceName,
interfaceName ):
- print "YACS.__init__: ", containerName, ';', instanceName
+ print("YACS.__init__: ", containerName, ';', instanceName)
SALOME_ComponentPy.SALOME_ComponentPy_i.__init__(self, orb, poa, contID,
containerName, instanceName,
- interfaceName, 0)
+ interfaceName, False)
SALOME_DriverPy.SALOME_DriverPy_i.__init__(self, interfaceName)
# --- store a naming service interface instance in _naming_service atribute
procExec_i = proc_i(xmlFile)
logger=procExec_i.p.getLogger("parser")
if not logger.isEmpty():
- print "The imported file has errors :"
- print logger.getStr()
+ print("The imported file has errors :")
+ print(logger.getStr())
sys.stdout.flush()
return None
- except IOError, ex:
- print >> sys.stderr ,"IO Error: ", ex
+ except IOError as ex:
+ print("IO Error: ", ex, file=sys.stderr)
return None
- except ValueError,ex:
- print >> sys.stderr ,"Caught ValueError Exception:",ex
+ except ValueError as ex:
+ print("Caught ValueError Exception:",ex, file=sys.stderr)
return None
- except pilot.Exception,ex:
- print >> sys.stderr ,ex.what()
+ except pilot.Exception as ex:
+ print(ex.what(), file=sys.stderr)
return None
except:
traceback.print_exc()