5 import SALOME_ComponentPy
11 class SALOME_DriverPy_i(SALOMEDS__POA.Driver):
13 Python implementation of generic SALOMEDS driver.
14 Should be inherited by any Python module's engine
15 to provide persistence mechanism.
17 def __init__ (self, componentDataType):
18 print "SALOME_DriverPy.__init__: ",componentDataType
19 self._ComponentDataType = componentDataType
21 def IORToLocalPersistentID(self, theSObject, IORString, isMultiFile, isASCII):
22 return theSObject.GetID()
24 def LocalPersistentIDToIOR(self, theSObject, PersistentID, isMultiFile, isASCII):
27 def ComponentDataType(self):
28 return self._ComponentDataType
30 def Save(self, theComponent, theURL, isMultiFile):
33 def SaveASCII(self, theComponent, theURL, isMultiFile):
34 return self.Save(theComponent, theURL, isMultiFile)
36 def Load(self, theComponent, theStream, theURL, isMultiFile):
39 def LoadASCII(self, theComponent, theStream, theURL, isMultiFile):
40 return self.Load(theComponent, theStream, theURL, isMultiFile)
42 def Close(self, theComponent):
45 def CanPublishInStudy(self, theIOR):
48 def PublishInStudy(self, theStudy, theSObject, theObject, theName):
51 def CanCopy(self, theObject):
56 class EFICAS(EFICAS_ORB__POA.EFICAS_Gen,
57 SALOME_ComponentPy.SALOME_ComponentPy_i,
60 Pour etre un composant SALOME cette classe Python
61 doit avoir le nom du composant et heriter de la
62 classe EFICAS_Gen issue de la compilation de l'idl
63 par omniidl et de la classe SALOME_ComponentPy_i
64 qui porte les services generaux d'un composant SALOME
66 def __init__ (self, orb, poa, contID, containerName, instanceName,
68 print "EFICAS.__init__: ",containerName,' ',instanceName
69 SALOME_ComponentPy.SALOME_ComponentPy_i.__init__(self, orb, poa,
70 contID, containerName,instanceName, interfaceName, 0 )
71 SALOME_DriverPy_i.__init__( self, 'OTHER' )
72 # On stocke dans l'attribut _naming_service, une reference sur
73 # le Naming Service CORBA
74 self._naming_service=SALOME_ComponentPy.SALOME_NamingServicePy_i(self._orb)