Back to index

salome-kernel  6.5.0
Namespaces | Classes | Functions | Variables
KERNEL_PY.kernel Namespace Reference

Namespaces

namespace  datamodeler
namespace  deprecation
namespace  diclookup
namespace  enumerate
namespace  logger
namespace  parametric
namespace  pyunittester
namespace  services
namespace  studyedit
namespace  syshelper
namespace  termcolor
namespace  testdata
namespace  threadhelper
namespace  uiexception
namespace  unittester

Classes

class  Callable

Functions

def serialize
def unserialize
def TEST_serialization

Variables

list __all__ = [ "deprecation", "logger", "termcolor", "logconfig" ]

Function Documentation

def KERNEL_PY.kernel.serialize (   dataToSerialize)
Creates a string description of the specified data.
.. attribute:: dataToSerialize
a data object to serialize

Definition at line 35 of file __init__.py.

00035 
00036 def serialize(dataToSerialize):
00037     """
00038     Creates a string description of the specified data.
00039     .. attribute:: dataToSerialize
00040     a data object to serialize
00041     """
00042     serialstring = pickle.dumps(dataToSerialize)
00043     return serialstring

Here is the caller graph for this function:

Definition at line 66 of file __init__.py.

00066 
00067 def TEST_serialization():
00068     from testdata import TestData
00069     ref_name = "my study case"
00070     studyData = TestData()
00071     studyData.setName(ref_name)
00072 
00073     print "serialize data ..."
00074     serialString = serialize(studyData)
00075     print "unserialize data ..."
00076     unserialData = unserialize(serialString)
00077 
00078     res_name = unserialData.getName()
00079     print res_name
00080     if ( ref_name != res_name ):
00081         return False
00082 
00083     unserialData.log()
00084     unserialData.setName("an other name")
00085 
00086     return True

Here is the call graph for this function:

def KERNEL_PY.kernel.unserialize (   stringToUnserialize)
Creates a data object from its string description. The string description
is supposed to be obtained by a call to serialize.
.. attribute:: stringToUnserialize
a string description of the object

Definition at line 44 of file __init__.py.

00044 
00045 def unserialize(stringToUnserialize):
00046     """
00047     Creates a data object from its string description. The string description
00048     is supposed to be obtained by a call to serialize.
00049     .. attribute:: stringToUnserialize
00050     a string description of the object
00051     """
00052     data = pickle.loads(stringToUnserialize)
00053     return data

Here is the caller graph for this function:


Variable Documentation

list KERNEL_PY.kernel.__all__ = [ "deprecation", "logger", "termcolor", "logconfig" ]

Definition at line 21 of file __init__.py.