1 # -*- coding: utf-8 -*-
3 print "EFICAS.__init__: 1"
6 import SALOME_ComponentPy
8 print "EFICAS.__init__: 2"
13 class SALOME_DriverPy_i(SALOMEDS__POA.Driver):
15 Python implementation of generic SALOMEDS driver.
16 Should be inherited by any Python module's engine
17 to provide persistence mechanism.
19 def __init__ (self, componentDataType):
20 print "SALOME_DriverPy.__init__: ",componentDataType
21 self._ComponentDataType = componentDataType
23 def IORToLocalPersistentID(self, theSObject, IORString, isMultiFile, isASCII):
24 return theSObject.GetID()
26 def LocalPersistentIDToIOR(self, theSObject, PersistentID, isMultiFile, isASCII):
29 def ComponentDataType(self):
30 return self._ComponentDataType
32 def Save(self, theComponent, theURL, isMultiFile):
35 def SaveASCII(self, theComponent, theURL, isMultiFile):
36 return self.Save(theComponent, theURL, isMultiFile)
38 def Load(self, theComponent, theStream, theURL, isMultiFile):
41 def LoadASCII(self, theComponent, theStream, theURL, isMultiFile):
42 return self.Load(theComponent, theStream, theURL, isMultiFile)
44 def Close(self, theComponent):
47 def CanPublishInStudy(self, theIOR):
50 def PublishInStudy(self, theStudy, theSObject, theObject, theName):
53 def CanCopy(self, theObject):
58 class EFICAS(EFICAS_ORB__POA.EFICAS_Gen,
59 SALOME_ComponentPy.SALOME_ComponentPy_i,
62 Pour etre un composant SALOME cette classe Python
63 doit avoir le nom du composant et heriter de la
64 classe EFICAS_Gen issue de la compilation de l'idl
65 par omniidl et de la classe SALOME_ComponentPy_i
66 qui porte les services generaux d'un composant SALOME
68 def __init__ (self, orb, poa, contID, containerName, instanceName,
70 print "EFICAS.__init__: ",containerName,' ',instanceName
71 SALOME_ComponentPy.SALOME_ComponentPy_i.__init__(self, orb, poa,
72 contID, containerName,instanceName, interfaceName, 0 )
73 SALOME_DriverPy_i.__init__( self, 'OTHER' )
74 # On stocke dans l'attribut _naming_service, une reference sur
75 # le Naming Service CORBA
76 self._naming_service=SALOME_ComponentPy.SALOME_NamingServicePy_i(self._orb)