import pickle
from ..Interfaces.DefaultInterface import DefaultInterface
from . import DictSource, Sources
[docs]@Sources.register("InternalSource")
class InternalSource(DictSource.DictSource):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.interface = DefaultInterface
[docs] @staticmethod
def can_unpack_value(value):
return True
[docs] @staticmethod
def unpack_value(value):
obj = pickle.loads(value)
return obj
[docs] def pack_value(self, value):
obj = pickle.dumps(value)
return obj