blob: 722fedf05eebe858a2b20a28bd8a699461cad98c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# SPDX-License-Identifer: Apache-2.0
# Copyright 2021 The Meson development team
from pathlib import Path
import pickle
from .loaderbase import LoaderBase
from .model import ReferenceManual
class LoaderPickle(LoaderBase):
def __init__(self, in_file: Path) -> None:
super().__init__()
self.in_file = in_file
def load_impl(self) -> ReferenceManual:
res = pickle.loads(self.in_file.read_bytes())
assert isinstance(res, ReferenceManual)
return res
# Assume that the pickled data is OK and skip validation
def load(self) -> ReferenceManual:
return self.load_impl()
|