Salome HOME
Preparation of 3.1.0a2: merge with BR_3_0_0_OCC
[samples/pyhello.git] / src / PYHELLO / PYHELLO.py
index f27c680b4bb5017e20da85c7ba3f5df9994adb0d..527fa8064f2f7714c47278cfc1ca719d27530b1e 100644 (file)
@@ -1,8 +1,10 @@
 import PYHELLO_ORB__POA
 import SALOME_ComponentPy
+import SALOME_DriverPy
 
 class PYHELLO(PYHELLO_ORB__POA.PYHELLO_Gen,
-              SALOME_ComponentPy.SALOME_ComponentPy_i):
+              SALOME_ComponentPy.SALOME_ComponentPy_i,
+              SALOME_DriverPy.SALOME_DriverPy_i):
     """
         Pour etre un composant SALOME cette classe Python
         doit avoir le nom du composant et heriter de la
@@ -10,16 +12,16 @@ class PYHELLO(PYHELLO_ORB__POA.PYHELLO_Gen,
         par omniidl et de la classe SALOME_ComponentPy_i
         qui porte les services generaux d'un composant SALOME
     """
-    def __init__ (self, orb, poa, contID, containerName, instanceName, 
-                  interfaceName):
-        print "PYHELLO.__init__: ",containerName,' ',instanceName
+    def __init__ ( self, orb, poa, contID, containerName, instanceName, 
+                   interfaceName ):
+        print "PYHELLO.__init__: ", containerName, ';', instanceName
         SALOME_ComponentPy.SALOME_ComponentPy_i.__init__(self, orb, poa,
-                    contID, containerName,instanceName, interfaceName, 0 )
+                    contID, containerName, instanceName, interfaceName, 0)
+        SALOME_DriverPy.SALOME_DriverPy_i.__init__(self, interfaceName)
         # On stocke dans l'attribut _naming_service, une reference sur
         # le Naming Service CORBA
-        self._naming_service=SALOME_ComponentPy.SALOME_NamingServicePy_i(self._orb)
+        self._naming_service = SALOME_ComponentPy.SALOME_NamingServicePy_i( self._orb )
 
-    def makeBanner(self,name):
-        banner= "Hello %s" % name
+    def makeBanner( self, name ):
+        banner = "Hello %s!" % name
         return banner
-