Salome HOME
Merge branch 'V9_2_BR'
[modules/kernel.git] / src / Container / SALOME_ComponentPy.py
index 89d1ab0aaa0ce2ef8f6a0daa353b4ecd80eec5ee..4decad903cc7ff622eba3e9994458dfe8805b8cd 100755 (executable)
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
 #  -*- coding: iso-8859-1 -*-
 # Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 #
@@ -46,7 +46,7 @@ from libNOTIFICATION import *
 
 from SALOME_utilities import *
 
-from thread import *
+from _thread import *
 
 #=============================================================================
 
@@ -63,7 +63,7 @@ class SALOME_ComponentPy_i (Engines__POA.EngineComponent):
     #-------------------------------------------------------------------------
 
     def __init__ (self, orb, poa, contID, containerName,
-                  instanceName, interfaceName, notif=0):
+                  instanceName, interfaceName, notif=False):
         # Notif for notification services
         # NOT YET IMPLEMENTED
         MESSAGE(  "SALOME_ComponentPy_i::__init__" + " " + str (containerName) + " " + str(instanceName) + " " + str(interfaceName) )
@@ -172,7 +172,7 @@ class SALOME_ComponentPy_i (Engines__POA.EngineComponent):
         self._StartUsed = self.CpuUsed_impl()
         self._ThreadCpuUsed = 0
         self._Executed = 1
-        print "beginService for ",serviceName," Component instance : ",self._instanceName
+        print("beginService for ",serviceName," Component instance : ",self._instanceName)
         MESSAGE( "SALOME_ComponentPy_i::beginService _StartUsed " + str( self._ThreadId ) + " " + str( self._StartUsed ) )
         for e in self._fieldsDict:
           key=e.key
@@ -186,7 +186,7 @@ class SALOME_ComponentPy_i (Engines__POA.EngineComponent):
     def endService(self , serviceName ):
         MESSAGE(  "Send EndService notification for " + str( self._ThreadId ) + " " + str(serviceName) + " for graph/node " + str(self._graphName) + " " + str(self._nodeName) + " CpuUsed " + str( self.CpuUsed_impl() ) )
         MESSAGE(  "Component instance : " + str(self._instanceName) )
-        print "endService for",serviceName,"Component instance :",self._instanceName,"Cpu Used:",self.CpuUsed_impl()," (s) "
+        print("endService for",serviceName,"Component instance :",self._instanceName,"Cpu Used:",self.CpuUsed_impl()," (s) ")
 
 
     #-------------------------------------------------------------------------
@@ -292,11 +292,11 @@ class SALOME_ComponentPy_i (Engines__POA.EngineComponent):
 
     #-------------------------------------------------------------------------
 
-    def DumpPython(self, theStudy, isPublished, isMultiFile):
+    def DumpPython(self, isPublished, isMultiFile):
         aBuffer = "\0"
         if isMultiFile :
-            aBuffer = "def RebuildData(theStudy): pass\n\0"
-        return (aBuffer, 1)
+            aBuffer = "def RebuildData(): pass\n\0"
+        return (aBuffer.encode(), 1)
 
     #-------------------------------------------------------------------------