2015-06-18 10:25:33 -06:00
|
|
|
##
|
|
|
|
##
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# TODO
|
2016-03-16 16:32:17 -05:00
|
|
|
#
|
|
|
|
#
|
2015-06-18 10:25:33 -06:00
|
|
|
# SOFTWARE HISTORY
|
2016-03-16 16:32:17 -05:00
|
|
|
#
|
2015-06-18 10:25:33 -06:00
|
|
|
# Date Ticket# Engineer Description
|
|
|
|
# ------------ ---------- ----------- --------------------------
|
|
|
|
# 08/20/10 njensen Initial Creation.
|
2016-03-16 16:32:17 -05:00
|
|
|
#
|
|
|
|
#
|
2015-06-18 10:25:33 -06:00
|
|
|
#
|
|
|
|
|
2016-10-18 23:24:06 -05:00
|
|
|
__all__ = ['SerializationException']
|
2015-06-18 10:25:33 -06:00
|
|
|
|
2016-04-16 17:00:50 -06:00
|
|
|
from . import dstypes, adapters
|
|
|
|
from . import DynamicSerializationManager
|
2015-06-18 10:25:33 -06:00
|
|
|
|
|
|
|
class SerializationException(Exception):
|
2016-03-16 16:32:17 -05:00
|
|
|
|
2015-06-18 10:25:33 -06:00
|
|
|
def __init__(self, message=None):
|
|
|
|
self.message = message
|
2016-03-16 16:32:17 -05:00
|
|
|
|
2015-06-18 10:25:33 -06:00
|
|
|
def __str__(self):
|
|
|
|
if self.message:
|
2016-03-16 16:32:17 -05:00
|
|
|
return self.message
|
2015-06-18 10:25:33 -06:00
|
|
|
else:
|
|
|
|
return ""
|
2016-03-16 16:32:17 -05:00
|
|
|
|
2015-06-18 10:25:33 -06:00
|
|
|
def serialize(obj):
|
|
|
|
dsm = DynamicSerializationManager.DynamicSerializationManager()
|
|
|
|
return dsm.serializeObject(obj)
|
|
|
|
|
|
|
|
def deserialize(bytes):
|
|
|
|
dsm = DynamicSerializationManager.DynamicSerializationManager()
|
2016-10-18 23:24:06 -05:00
|
|
|
return dsm.deserializeBytes(bytes)
|