]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
PAL10120: provide default implementation of SALOMEDS::Driver for python modules
authorjfa <jfa@opencascade.com>
Fri, 30 Sep 2005 08:06:30 +0000 (08:06 +0000)
committerjfa <jfa@opencascade.com>
Fri, 30 Sep 2005 08:06:30 +0000 (08:06 +0000)
src/Container/Makefile.in
src/Container/SALOME_DriverPy.py [new file with mode: 0644]

index 5ccebde83945342646b59f1c2e0dd23ab3a85e1c..a57a5cffb8a2f333279ff2aa9b2d90e56dfe405f 100644 (file)
@@ -36,7 +36,8 @@ VPATH=.:@srcdir@:@top_srcdir@/idl
 
 EXPORT_PYSCRIPTS = SALOME_ComponentPy.py \
        SALOME_ContainerPy.py \
-       SALOME_Container.py
+       SALOME_Container.py \
+       SALOME_DriverPy.py
 
 EXPORT_HEADERS = \
        SALOME_Component_i.hxx \
diff --git a/src/Container/SALOME_DriverPy.py b/src/Container/SALOME_DriverPy.py
new file mode 100644 (file)
index 0000000..8728ffa
--- /dev/null
@@ -0,0 +1,44 @@
+import SALOMEDS__POA
+
+class SALOME_DriverPy_i(SALOMEDS__POA.Driver):
+    """
+    """
+    _ComponentDataType = None
+
+    def __init__ (self, componentDataType):
+        print "SALOME_DriverPy.__init__: ",componentDataType
+        _ComponentDataType = componentDataType
+
+    def IORToLocalPersistentID(self, theSObject, IORString, isMultiFile, isASCII):
+        return theSObject.GetID()
+
+    def LocalPersistentIDToIOR(self, theSObject, PersistentID, isMultiFile, isASCII):
+        return ""
+
+    def ComponentDataType(self):
+        return _ComponentDataType
+
+    def Save(self, theComponent, theURL, isMultiFile):
+        return NULL
+
+    def SaveASCII(self, theComponent, theURL, isMultiFile):
+        return self.Save(theComponent, theURL, isMultiFile)
+
+    def Load(self, theComponent, theStream, theURL, isMultiFile):
+        return 1
+
+    def LoadASCII(self, theComponent, theStream, theURL, isMultiFile):
+        return self.Load(theComponent, theStream, theURL, isMultiFile)
+
+    def Close(self, theComponent):
+        pass
+
+    def CanPublishInStudy(self, theIOR):
+        return 1
+
+    def PublishInStudy(self, theStudy, theSObject, theObject, theName):
+        return NULL
+
+    def CanCopy(self, theObject):
+        return 0
+