Salome HOME
d1f1c4e27b13339b45975275fb9067c59d1a44f9
[modules/kernel.git] / src / SALOMEDS / SALOME_DriverPy.py
1 import SALOMEDS__POA
2
3 class SALOME_DriverPy_i(SALOMEDS__POA.Driver):
4     """
5     Python implementation of generic SALOMEDS driver.
6     Should be inherited by any Python module's engine
7     to provide persistence mechanism.
8     """
9     def __init__ (self, componentDataType):
10         print "SALOME_DriverPy.__init__: ",componentDataType
11         self._ComponentDataType = componentDataType
12
13     def IORToLocalPersistentID(self, theSObject, IORString, isMultiFile, isASCII):
14         return theSObject.GetID()
15
16     def LocalPersistentIDToIOR(self, theSObject, PersistentID, isMultiFile, isASCII):
17         return ""
18
19     def ComponentDataType(self):
20         return self._ComponentDataType
21
22     def Save(self, theComponent, theURL, isMultiFile):
23         return NULL
24
25     def SaveASCII(self, theComponent, theURL, isMultiFile):
26         return self.Save(theComponent, theURL, isMultiFile)
27
28     def Load(self, theComponent, theStream, theURL, isMultiFile):
29         return 1
30
31     def LoadASCII(self, theComponent, theStream, theURL, isMultiFile):
32         return self.Load(theComponent, theStream, theURL, isMultiFile)
33
34     def Close(self, theComponent):
35         pass
36
37     def CanPublishInStudy(self, theIOR):
38         return 1
39
40     def PublishInStudy(self, theStudy, theSObject, theObject, theName):
41         return NULL
42
43     def CanCopy(self, theObject):
44         return 0
45