Salome HOME
Merge branch 'V9_2_2_BR'
[modules/kernel.git] / src / Container / SALOME_ComponentPy.py
old mode 100755 (executable)
new mode 100644 (file)
index 5386477..98e695e
@@ -1,6 +1,5 @@
-#! /usr/bin/env python
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -46,7 +45,7 @@ from libNOTIFICATION import *
 
 from SALOME_utilities import *
 
-from thread import *
+from _thread import *
 
 #=============================================================================
 
@@ -59,12 +58,11 @@ class SALOME_ComponentPy_i (Engines__POA.EngineComponent):
     _orb = None
     _poa = None
     _fieldsDict = []
-    _studyId = -1
 
     #-------------------------------------------------------------------------
 
     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) )
@@ -173,7 +171,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
@@ -187,7 +185,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) ")
 
 
     #-------------------------------------------------------------------------
@@ -293,16 +291,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)
-
-    #-------------------------------------------------------------------------
-
-    def getStudyId(self):
-        return self._studyId
+            aBuffer = "def RebuildData(): pass\n\0"
+        return (aBuffer.encode(), 1)
 
     #-------------------------------------------------------------------------
 
@@ -311,7 +304,7 @@ class SALOME_ComponentPy_i (Engines__POA.EngineComponent):
 
     #-------------------------------------------------------------------------
 
-    def getObjectInfo(self, studyId, entry):
+    def getObjectInfo(self, entry):
         return ""
 
     #-------------------------------------------------------------------------