From 17f60b7fe85739d018e0f10fe0ab7ceb21ba83f9 Mon Sep 17 00:00:00 2001 From: jfa Date: Fri, 30 Sep 2005 08:06:30 +0000 Subject: [PATCH] PAL10120: provide default implementation of SALOMEDS::Driver for python modules --- src/Container/Makefile.in | 3 ++- src/Container/SALOME_DriverPy.py | 44 ++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 src/Container/SALOME_DriverPy.py diff --git a/src/Container/Makefile.in b/src/Container/Makefile.in index 5ccebde83..a57a5cffb 100644 --- a/src/Container/Makefile.in +++ b/src/Container/Makefile.in @@ -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 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 + -- 2.39.2