Back to index

salome-kernel  6.5.0
SALOME_DriverPy.py
Go to the documentation of this file.
00001 #  -*- coding: iso-8859-1 -*-
00002 # Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00003 #
00004 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00005 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00006 #
00007 # This library is free software; you can redistribute it and/or
00008 # modify it under the terms of the GNU Lesser General Public
00009 # License as published by the Free Software Foundation; either
00010 # version 2.1 of the License.
00011 #
00012 # This library is distributed in the hope that it will be useful,
00013 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015 # Lesser General Public License for more details.
00016 #
00017 # You should have received a copy of the GNU Lesser General Public
00018 # License along with this library; if not, write to the Free Software
00019 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00020 #
00021 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00022 #
00023 
00024 ## @package SALOME_DriverPy
00025 #  \brief python implementation of SALOMEDS::Driver interface
00026 #
00027 import SALOMEDS__POA
00028 
00029 ## Python implementation of generic SALOMEDS::Driver.
00030 #
00031 #
00032 class SALOME_DriverPy_i(SALOMEDS__POA.Driver):
00033     """
00034     Should be inherited by any Python module's engine
00035     to provide persistence mechanism.
00036     """
00037     def __init__ (self, componentDataType):
00038         self._ComponentDataType = componentDataType
00039 
00040     def IORToLocalPersistentID(self, theSObject, IORString, isMultiFile, isASCII):
00041         return theSObject.GetID()
00042 
00043     def LocalPersistentIDToIOR(self, theSObject, PersistentID, isMultiFile, isASCII):
00044         return ""
00045 
00046     def ComponentDataType(self):
00047         return self._ComponentDataType
00048 
00049     def Save(self, theComponent, theURL, isMultiFile):
00050         return ""
00051 
00052     def SaveASCII(self, theComponent, theURL, isMultiFile):
00053         return self.Save(theComponent, theURL, isMultiFile)
00054 
00055     def Load(self, theComponent, theStream, theURL, isMultiFile):
00056         return 1
00057 
00058     def LoadASCII(self, theComponent, theStream, theURL, isMultiFile):
00059         return self.Load(theComponent, theStream, theURL, isMultiFile)
00060 
00061     def Close(self, theComponent):
00062         pass
00063 
00064     def CanPublishInStudy(self, theIOR):
00065         return 1
00066 
00067     def PublishInStudy(self, theStudy, theSObject, theObject, theName):
00068         return None
00069 
00070     def CanCopy(self, theObject):
00071         return 0
00072