From: jfa Date: Fri, 30 Sep 2005 09:01:07 +0000 (+0000) Subject: PAL10120: provide default implementation of SALOMEDS::Driver for python modules X-Git-Tag: V2_2_6~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=81406bf71e1dfd5509e53d37092d668273d7b140;p=modules%2Fkernel.git PAL10120: provide default implementation of SALOMEDS::Driver for python modules --- diff --git a/src/Container/Makefile.in b/src/Container/Makefile.in index fa963603b..a29de69eb 100644 --- a/src/Container/Makefile.in +++ b/src/Container/Makefile.in @@ -34,7 +34,7 @@ VPATH=.:@srcdir@:@top_srcdir@/idl @COMMENCE@ -EXPORT_PYSCRIPTS = SALOME_ComponentPy.py SALOME_ContainerPy.py +EXPORT_PYSCRIPTS = SALOME_ComponentPy.py SALOME_ContainerPy.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 index 000000000..8728ffae8 --- /dev/null +++ b/src/Container/SALOME_DriverPy.py @@ -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 +