Source code for solidipes_core_plugin.loaders.python_pickle
from solidipes.loaders.file import File
[docs]
class PythonPickle(File):
"""Python Pickle file"""
supported_mime_types = {"python/pickle": ["pkl"]}
def __init__(self, **kwargs):
super().__init__(**kwargs)
from ..viewers.python_pickle import PythonPickle as PythonPickleViewer
self.preferred_viewer = PythonPickleViewer
@File.loadable
def obj(self):
f = open(self.file_info.path, "rb")
import pickle
return pickle.load(f)